> This is a good solution and why not add it to fltk as something like > "Fl::try_close_all() or Fl::try_exit() or Fl::exit()".
No, I don't think that would add all that much value - there are too many different things that might be appropriate to do, or different ways to deal with closing windows that are "dirty", that I think it is better to code it explicitly to match each use case. And as Albrecht's fragment shows, it need not be that much to add... > But it still have a problem, when the window "me" is the main > window with > some important functionality needed to complete the pending > work and it's > gone because it was the first on the list and was hidden, the > user will be > left with a child window without the main application window > and maybe > can't do what they need. Sure, but you would of course always check whether the first window was "dirty" or not before you closed it anyway (Albrecht's demo is not intended to be the full solution...), and if you need to close the main window last, after all the subsidiary windows are closed (including any subsequent actions to clean them) then a different model may be required. I tend to build a list of active windows. You can do this as you create the windows, or by using the first/next methods. Any windows that are not "dirty" can be closed directly. Any "dirty" windows get actioned then closed, and the (often global) main_win gets closed last. That seems to work OK for me - is that not what you need? SELEX Galileo Ltd Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

