On 05/03/12 12:40, dirac wrote: > Hi guys, > let's say I have a window with a button in it. The button, if clicked, > creates a sub window: > > --- > void button_callback(...) { > new Fl_Window(...); > } > --- > > When I close the 'master' window (the one which contains the button) I would > like to delete all the other subwindows. Is there a way to do it without > keeping a pointer to all the child windows?
Agreeing with what Ian said, I would add that it sounds like only your app knows about the window associations (ie. which is the 'master' and which are the 'subs') It sounds to me it would be necessary for your 'master' window to keep track of the subs by maintaining an array of pointers to them. It'd be best if your master window was a derived class from Fl_Window, and have your own hide() method that runs hide() on all the windows in your array, as well as calling Fl_Window::hide() to hide the main one. _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk