Hi all,

What is the method to destroy any windows called open by the main window, if 
the main window is closed? I realised i might need this when i had a new window 
open that has limited controls, i closed the main program window behind it and 
saw that the second window remained open, 'high and dry' as the user would not 
be able to do anything further and would have to just x it out or ESC.

i can think of ways to manage this, for example maintaining 'isOpen' boolean, 
but i was wondering what is a more appropriate and sophisticated method based 
around hierarchies in FLTK? i am certain this is a child parent thing but i 
naiively assumed i was getting that relationship automagically by creating the 
object from a mainwindow callback.

class MainWindow declares mainWin as well as writeWin(the second window)


both windows are simply declared as double windows.

in the callback for the mainWin writeBtn:

//WGen inherits class MainWindow
//TWrite inherits class WGEN

void WGen::WriteCB_i(Fl_Widget* wgt, void* v)
{
    TWrite* tWrite = new TWrite; //constructor calls writeWin->show();
}

I admit this is not pretty!






_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to