> > 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.
>
> A very good point, can't believe i overlooked that in the first place
tunnel vision there.. i would not want a new instance at all no, and you
have solved a number of other future issues there too, together with the
hide() advice earlier, the application is not enormous so it is probably
best to create all required windows at startup and show as required. the
shared data for widgets and work in the methods the window displays can
be supplied by the respective class functions as usual.. sorted! Just
for debug purposes, what happens if show() is called on a window that
is already showing? Shall i set flags to avoid this?
cheers.

Also i have an issue building version 1.3, seperate thread opened.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to