diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2007-12-27 11:02:27 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2007-12-27 11:02:27 +0000 |
| commit | 7a3a8c18922d035370653bf6269af40002a3c08b (patch) | |
| tree | 142deb9dcf68c6f9424fd7642417d75f1bdd7ce1 /documentation/basics.html | |
| parent | f0ccbbabd82b4cd709df809fe30f829b3cd9539f (diff) | |
STR 1815: Added begin() and end() information to the Basics chapter. Hope you'll like it
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6007 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'documentation/basics.html')
| -rw-r--r-- | documentation/basics.html | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/documentation/basics.html b/documentation/basics.html index 522e7d845..efb8d6926 100644 --- a/documentation/basics.html +++ b/documentation/basics.html @@ -45,7 +45,8 @@ window. All following widgets will automatically be children of this window.</P> Fl_Window *window = new <A href="Fl_Window.html#Fl_Window">Fl_Window</A>(300,180); </PRE></UL> -<P>Then we create a box with the "Hello, World!" string in it.</P> +<P>Then we create a box with the "Hello, World!" string in it. FLTK automatically adds +the new box to <tt>window</tt>, the current grouping widget.</P> <UL><PRE> Fl_Box *box = new <A href="Fl_Box.html#Fl_Box">Fl_Box</A>(20,40,260,100,"Hello, World!"); @@ -60,7 +61,7 @@ box-><A href=Fl_Widget.html#Fl_Widget.labelfont>labelfont</A>(FL_BOLD+FL_ITAL box-><A href=Fl_Widget.html#Fl_Widget.labeltype>labeltype</A>(FL_SHADOW_LABEL); </PRE></UL> -<P>We tell FLTK that we will not add any more widgets to the window.</P> +<P>We tell FLTK that we will not add any more widgets to <tt>window</tt>.</P> <UL><PRE> window-><A href=Fl_Group.html#Fl_Group.end>end</A>(); @@ -105,6 +106,24 @@ defaults to <tt>NULL</tt>. The label string must be in static storage such as a string constant because FLTK does not make a copy of it - it just uses the pointer.</P> +<H3>Creating Widget hierarchies</H3> + +<P>Widgets are commonly ordered into functional groups, which +in turn may be grouped again, creating a hierarchy of widgets. +FLTK makes it easy to fill groups by automatically adding all widgets +that are created between a <tt>myGroup->begin()</tt> and +<tt>myGroup->end()</tt>. In this example, <tt>myGroup</tt> +would be the <i>current</i> group.</P> + +<P>Newly created groups and their derived widgets implicitly call +<tt>begin()</tt> in the constructor, effectively adding all +subsequently created widgets to itself until <tt>end()</tt> +is called.</P> + +<P>Setting the current group to <tt>NULL</tt> will stop automatic +hierarchies. New widgets can now be added manually using +<tt>Fl_Group::add(...)</tt> and <tt>Fl_Group::insert(...)</tt>.</P> + <H3>Get/Set Methods</H3> <P><tt>box->box(FL_UP_BOX)</tt> sets the type of box the |
