On 1 Nov 2012, at 17:42, Klaus Rudolph wrote:

> MacArthur, Ian (SELEX GALILEO, UK) wrote:
> 
>> Fl::run() will return if all the windows are hidden, so just calling 
>> 
>>   main_window->hide();
>> 
>> should do the trick.
>> 
>> Deleting the window is seldom useful - the system will reap the window's 
>> children on application exit anyway, which may be what's triggering your 
>> double-free warnings I'd guess.
>> 
> 
> Thanks a lot! I thought that hidden things come back again :-)

Yes, that's right, hidden things can come back again.

But you asked how to make Fl::run() return, and the answer is that Fl::run() 
will return when there are no more window elements visible for it to service. 
So if you hide() all of your windows, then Fl::run() will return.
That does not mean that the widgets no longer exist, only that there is nothing 
for Fl::run() to do servicing them.
An invisible widget does not need to be drawn and can not receive inputs...


> I
> expected something like destroy, kill or remove. Hide sounds not so
> final to me :-)

widget->hide() is only as final as you want it to be.

If your program expires when Fl::run() returns, then hiding all your widgets 
will be pretty final (!) but if you know that all GUI elements may be hidden in 
your application, but that you want it to continue in the background, then you 
simply catch the case that Fl::run() returns and do not exit at that point.

If you want to re-display your GUI, simply call show() on your windows again 
and re-call Fl::run()...




_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to