18.1 Overview

Group class can be used to lay out a number of children in various ways. When the parent's size changes, groups relayout their children which can be very useful to create windows that are freely resizable in all directions.

The following different group types are supported by RapaGUI:

<hgroup>
Group children will be laid out in a row (vertical).

<vgroup>
Group children will be laid out in a column (horizontal).

<colgroup>
Group children will be laid out in columns.

<scrollgroup>
A group with scrollbars. This is a special group which shows an embedded group with scrollbars. See Scrollgroup class for details.

Column groups are useful if you need to have identical widget sizes for all your children in a group for a more pleasant visual appearance. For example, imagine a form made up of text entry widgets and text objects. It is recommended to use a <colgroup> here because it leads to a clear and ordered visual appearance. Here's an example:

 
<colgroup columns="2">
   <label>Name</label>
   <textentry/>
   <label>Street</label>
   <textentry/>
   <label>City</label>
   <textentry/>
   <label>Zip code</label>
   <textentry/>
   <label>Country</label>
   <textentry/>
   <label>Telephone</label>
   <textentry/>
   <label>Email</label>
   <textentry/>
</colgroup>

If we used a <vgroup> with one <hgroup> per row the appearance would be pretty bad because the text entry widget's width would be different for each line which looks pretty ugly.

Note that Group class doesn't derive from Area class because groups do not exist as physical widgets but they are just layout tools for their child widgets or groups. This is why you cannot use attributes and methods from Area class on group objects.


Show TOC