Paul R wrote:
> What is the method to destroy any windows called open by the main window, if
> the main window is closed?
If you want the program to shut down when the main window is closed,
then just setup a callback for the main window that exits the program,
eg:
----
void MainWinQuit() {
exit(0);
}
int main(..) {
..
mainwin->callback(MainWinQuit);
..
return(Fl::run());
}
----
MainWinQuit() will be called whenever the main window is closed,
either by ESC or by the user clicking the 'X' in the window manager.
The exit(0); will call all your destructors,
and will of course close all windows.
The MainWinQuit() callback can also be used to check if the user
has unsaved data and post a dialog warning so. If you return() from
the MainWinQuit() callback, you can prevent the main window from being
closed.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk