On 01/25/2013 09:13 AM, Moses McKnight wrote:
> Ok, I think I figured it out. The way I create the window is like this
> in a menu callback function:
>
> void gen_license_cb(Fl_Widget *w, void *ptr)
> {
> licgen generator;
> generator.make_window();
> generator.hub_id_input->type(FL_INT_INPUT);
> generator.hub_id_input->precision(0);
> generator.hub_id_input->value(hub_id);
> generator.window->show();
> }
>
> I think the object is being deleted after the show() even though the
> window is still there and active.
>
> What is the best way to keep the object around until the window is closed?
I looked at the code in fl_ask.cxx and added the following after
window->show()
while (generator.window->shown()) Fl::wait();
That worked. If anyone has a better way to do this please let me know.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk