Greg Ercolano wrote:

> 
>       Seems to me it's the difference between just creating
>       widgets, instead of having to call add() for everything.
> 
>       In other words, this:
> 
> group.begin();
>     out1 = new Fl_Output(..);
>     out2 = new Fl_Output(..);
>     but1 = new Fl_Button(..);
>     but2 = new Fl_Button(..);
> group.end();
> 
>       ..seems easier/less redundant code and readability wise than:
> 
> out1 = new Fl_Output(..);
> group.add(out1);
> out2 = new Fl_Output(..);
> group.add(out2);
> but1 = new Fl_Button(..);
> group.add(but1);
> but2 = new Fl_Button(..);
> group.add(but2);
>       

but what about:

      out1 = new Fl_Output( group, .. );
      out2 = new Fl_Output( group, .. );
      but1 = new Fl_Button( group, .. );
      but2 = new Fl_Button( group, .. );

The add still takes place in the base widget class constructor,
but rather than a system wide static pointer the constructor
has a line such as:

      widget::widget( widget* parent, .. ) {
          ..
         parent->add( this );
      };  // end widget constructor

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

Reply via email to