On 14.06.2011, at 17:18, asif saeed wrote:

> Finally, the following code worked. Can you tell me why?
> 
> int main(int argc, char **argv)
> {
> //        Fl_Group::current(NULL);
> //        Fl_Window *w = new Fl_Window(0,0,0,0);
> 
>        Fl_Button *button1 = new Fl_Button(2,2,80,40,"Hello");
> 
>        Fl_Group *flow_panel = new Fl_Group(2,2,100,100);
>        Fl_Group::current(flow_panel);
>        flow_panel->begin();
>        flow_panel->add(button1);
>        flow_panel->end();

Calling end() makes the parent of flow_panel the "current" group. Since there 
is no parent, the current group is null, and newly created windows are top 
level windows.

>        Fl_Window *window = new Fl_Window(2,2,300,300);
>        Fl_Group::current(window);

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to