[Gambas-user] "Me.Persistent = True" does not work?
bsteers4 at gmail.com
Tue Jan 11 14:16:35 CET 2022
On Tue, 11 Jan 2022 at 11:42, Cristiano Guadagnino <criguada at gmail.com>
> Il giorno mar 11 gen 2022 alle ore 12:07 Benoît Minisini <g4mba5 at gmail.com>
> ha scritto:
>> It's a different thing.
>> GUI applications automatically quit when there have no opened windows
>> (persistent or not) or trayicons (or watched file descriptors) anymore.
>> Because then the user has no way to interact with the program anymore,
>> so it seems a good idea to stop the program.
>> You set the 'Persistent' property when you don't want to recreate your
>> window each time you use it, usually when it's a dialog, or a tool window.
> Thank you Benoit, the concept is now clear, but the documentation isn't.
> I'll propose a change in the docs and then I'll submit it to the list for
> On another note: my application does have a tray icon, but the application
> is closed nonetheless when I click on "X" on the main window.
> And this sparks another thought: unfortunately it is not always possible
> to close an application by closing the main window. Sometimes you have to
> use the QUIT statements, but that generates other problems in GUI programs.
> So we have two distinct and somewhat opposite problems here: an
> application that closes when it shouldn't (because I still have the tray
> icon running) and an application that can't be cleanly closed when it
> I'll send a separate message for this second issue with some code
> demonstrating the problem.
> All this is on Gambas 3.16.3: I'm not using development versions on
If an application won't quit properly it's usually because an open file
handle/stream has not been closed or a timer is still running or something
If all open handles like that are closed then Quit does not give any errors
, but is also not required to be used either :).
The errors you see when using quit will give a clue as to what's still open.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User