-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a function to close all windows and return from Fl::run() #498
Comments
Here is what the user originally wrote :
I would therefore tend to believe the new function should delete all windows and subwindows rather than hide them, because if they're only hidden, Fl_Window_Driver objects will be destroyed, but Fl_Window objects won't be. Class Fl_Window_Driver is not accessible to FLTK users, so program resources are likely to be stored in Fl_Window controlled-structures. Does this make sense at all in terms of program resources if exit() is called after window destruction ? That is, wouldn't program resources be equally freed with and without the new function? If yes, the new function would make sense only if the program continues windowless after the function call. I may have missed something from the previous discussion. |
@ManoloFLTK The OP also wrote:
I interpret this in the given context that the mentioned destructors would be called if the program came to a normal end after returning from Destructors would normally be called at a normal program exit (return from The OP did not say which destructors he would like to be called, particularly not if for any windows. Windows can also be allocated as normal program variables in What the user does with the mentioned message queues (for instance) is not specified. They may be allocated on the stack and would be destroyed automatically or the user could add some instructions like IMHO it's that simple: create a public function that closes all open windows (correctly!) w/o the issues discussed in the given thread, for instance that using That said, this GitHub Issue was only meant as a reminder to implement exactly this function because my time is pretty limited right now and I didn't want to forget this task (it's attached to milestone 1.4.0 for exactly that reason). A function that would also delete all (open!) windows would really be another topic with its own problems. I won't go into further details unless someone asks for this explicitly. |
OK. I see now that what the OP wants is a simple way to return from Fl::run(). What comes next is under the application's responsibility. So, yes, a new function Fl::hide_all_windows() is what's needed. |
Added and tested in 4bff152 |
This was requested by a user in fltk.general long ago. I'm opening this issue so the request doesn't get lost. Links to the discussion (the entire thread is very long):
We agreed upon adding a function called
Fl::hide_all_windows()
. Unfortunately this was not done yet but should be done before 1.4.0 is released.The text was updated successfully, but these errors were encountered: