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()". 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.
En 24/11/2010 13:02:21, Albrecht Schlosser <[email protected]> escribió: > On 24.11.2010, at 12:58, Albrecht Schlosser wrote: > >> I don't recommend this here, but if you think that you really need it, >> then you could try to call each window's callback before closing it, >> something like (untested): > > Sorry, I posted an older version of the code. It should read: > > static void cb_close(Fl_Widget *w, void*) { > Fl_Window *me = (Fl_Window *)w; > Fl_Window *win; > while (win = Fl::first_window()) { > if (win != me && win->callback()) { > win->do_callback(); // call each window's callback > if (Fl::first_window() == win) > break; // user decided not to close the window > } else { > win->hide(); // close window (no callback) > } > } > } -- Usando el revolucionario cliente de correo de Opera: http://www.opera.com/mail/ _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

