On Sunday 22 April 2007 00:22:30 Greg Ercolano wrote:
>
> I think you'll find if you re-arrange the code so that
> one window is not defined inside the other, it will work.
> (Because the second window is really a separate window)
>
> eg:
>
>
> // First window
> begin();
> // menu a child of first window
> menu = new PopupMenu(0, 0, w, h);
> menu->type(PopupMenu::POPUP3);
> menu->begin();
> about_item = new Item("About
clock");
> exit_item = new Item("Exit clock");
> menu->end();
> menu->callback(cb_menu, this);
> end();
> color(12);
> show();
>
> // Second window
> win = new Window(100, 100);
> win->begin();
> // put widgets in second window here
> win->end();
> win->show();
>
>
> That puts the menu on the first window.
> If you want it in the second window, just move the menu code
> between the win->begin() and win->end().
>
> From what I can tell, since the windows are separate, it doesn't
> (seem) to make sense to define one inside the definition of the
> other. I think what was happening in your case is the definition
> of the second window implied end()ing the first. I think.
> Maybe the developers can weigh in on this one; I'm not too
> familiar with fltk 2.0 to know if that's how it's supposed to work.
>
> But I think re-arranging the code so that the windows are defined
> separately makes sense, as they really are separate.
>
Yes that's logical, but I didn't wont to make separate window, I wanted to
make subwindow, window that is a child or dependent on the first one, so at
some point I could maybe set it modal... I wanted it to be something like
dialog window of the first one.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk