lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


  Hi,

  Usually iup.Close is called at the end of the program, not every time a script is run. 

  iup.Open is automatically called on require"iuplua", but once you did the require once I think Lua will mark iuplua as loaded and will not call its initialization function again. So the second time your script will fail because iup.Close was called.

  But if you really need to call iup.Close, then I think you should explicitly call iup.Open at the beginning of the script even calling require. 

  IUP was designed to be initialized and closed only once, although multiple times can be done. Notice that doing that every time a script is run turn your scripts slower than usual. 

Best,
Scuri


Em qui, 6 de jun de 2019 às 07:28, Jane Taubman <janetaubman@gmail.com> escreveu:
I have been working with Simon's application and am having a problem and wondered if there is a solution which I could ask Simon to implement

When I use this code

require 'iuplua'
iup.GetText('Send me a message','Hello')
thisdoesnotexist()
if iup.Close then iup.Close() end

It fails on line 3.  This means the iup.Close() is not called and the next time I run the script the program crashes out and closes completely.

As you can see at the point the script fails no dialogue is open,  using any iup dialogue of any sort and not getting to the iup.Close command has the same affect,  but this is the simplest one.

On Thu, 28 Mar 2019 at 13:38, Antonio Scuri <antonio.scuri@gmail.com> wrote:
  Hi Simon,

  I don't have a solution but a few comments.

  I wouldn't call iuplua_close for every script, if this is what you are doing. Using require is the recommended option. But notice that does not call IupClose anywhere. 

  I don't see why an error in Lua code would close an IUP dialog. If this happen before could be an error in older IupLua error management. The current IupLua error dialog allow 3 actions: Copy the error report to the clipboard, Continue with the execution (the Lua script will abort but will not close any dialogs), and Exit the application. You can replace this dialog with your own version that can close your dialogs.

Best,
Scuri

  

Em qua, 27 de mar de 2019 às 17:39, Simon Orde <SimonOrde@family-historian.co.uk> escreveu:

Hi – My Visual C++ app uses Lua to run scripts.  Following various upgrades, I now have a problem with scripts that use IUP.  If an error occurs in an IUP script, what usually happens is that instead of displaying a sensible error message, it shuts down my application somehow.  This is a new problem that has only started happening since I upgraded  my application from Visual Studio 2010 to 2017.  When I upgraded my compiler, I also upgraded from Lua 5.1 to Lua 5.3.5 and from IUP 3.9 to IUP 3.26.  That required a number of changes to get everything working.  I’ve manged to overcome most issues, but this one is still unresolved.

 

 



--