Pedro Henrique Linhares wrote:
> PS: just for the record I tried what Greg told me to do and I still getting
> that error.. And I didn't really understand how this parent() method is
> suppose to work. How can I create an hierarchy of widgets? Using the
> children() method? Or current()->add() method? I read the manual but it is
> not clear to me..
Using begin() and end() are the common ways to make widget hierarchies,
eg:
// window #1
Fl_Window *win = new Fl_Window();
win->begin(); // start of children of window
Fl_Menu_Bar *menu = new Fl_Menu_Bar(); // automatically a child of
window
Fl_Button *butt = new Fl_Button(); // automatically a child of
window
Fl_Group *grp = new Fl_Group(); // automatically a child of
window
grp->begin(); // start of children of group
Fl_Button *but2 = new Fl_Button(); // automatically a child of
group
Fl_Box *box = new Fl_Box(); // automatically a child of
group
grp->end(); // end of group, back to window
Fl_Button *but3 = new Fl_Button(); // automatically a child of
window
win->end(); // end of window
// window #2
Fl_Window *win2 = new Fl_Window(); // create a second window
..etc..
win2->end();
And once that hierarchy is created, then you can access the parents
and children by asking the widget who its parent() is, which window()
it's in, etc.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk