> Hi all,
>
> What is the method to destroy any windows called open by the main window, if
> the main window is closed?
[..]
What Ian said, but you have another problem lurking.
[..]
>
> void WGen::WriteCB_i(Fl_Widget* wgt, void* v)
> {
> TWrite* tWrite = new TWrite; //constructor calls writeWin->show();
> }
Do you really want/need another window every time the button
is pushed? Hopefully not, in which case I'd recommend
creating a single instance (probably in the main window's
constructor), and keeping a pointer to it around. Then
the button callback can just show it, and the main window's
callback can hide it at exit.
OTOH, if you really DO require a new window for each button
push, you have some work to do, because you'll no doubt want
to destroy these instances when the user dismisses the child
windows. That's a solvable problem, but it's not something
fltk is going to do for you auto-magically.
HTH,
Stan
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk