> > I whant to do a simple thing, to show a window inside other window.
> > The function  fltk::Window::show_inside(Window * parent)
> > should do it, but it does not show the window and application can
> > not leave fltk::run()
> > ...
> >     outer->show();
> >     inner->show_inside(outer);
> >     return fltk::run();
> > Where is the problem? Is it in FLTK or in the code shown above?
>
> I'm not an FLTK2 user, so this is a stab in the dark, but your outer
> window isn't actually shown until the fltk::run() handles the event.
>
> Can you arrange for outer's draw() method to show the inner window?
> Maybe with a static variable so that it is only shown the first time?
>
> Can you arrange for a timer event that will show inner after outer's
> draw() method has been called? Then it would be handled in fltk::run().
>
> D.
>

Thank you for reply!
I tried the following code and the result is the same, it does not show the 
inner window.

fltk::Window * inner;
fltk::Window * outer;

void callback(fltk::Widget * w, void * data)
{
  inner->show_inside(outer);
  cout<<"should show inner, but it does not"<<endl;
}

int main()
{
  outer = new fltk::Window(500,500, "outer");
  inner = new fltk::Window(200,200, "inner");
  outer->begin();
    fltk::Button *b = new fltk::Button(20,20,50,50, "button");
    b->callback(callback);
  outer->end();
  outer->show();
  return fltk::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to