@ManoloFLTK The OP also wrote:
In particular, on the Mac, I need to close message queues which are a precious resource.
I interpret this in the given context that the mentioned destructors would be called if the program came to a normal end after returning fromFl::run() but the OP was asking for a way (function) to do exactly (and only) this: close all open windows.
Destructors would normally be called at a normal program exit (return from main() ) but this would not happen if the user called the system function exit() to terminate the program rather than "leaving" Fl::run() in the normal way by closing all open windows so Fl::run() returns normally to the caller.
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 main() so that these windows would also be destroyed when main() returns (or not if they were instantiated with new ).
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 delete message_queue_xyz; after returning from Fl::run() which they can't do now because Fl::run() wouldn't return w/o closing all windows.
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 Fl::next_window() would be wrong in this context (see discussion).
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.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/498/1247297457@github.com>
[ Direct Link to Message ] |