The base widget container
Inherits from Widget
Subclasses: Pack Scroll Tabs Tile Window
Group.current | children | resizable |
add | child | find | ||
begin_layout | end_layout | remove | ||
type | name | summary |
Widget | resizable | Widget controlling resize behavior |
type | name | summary |
void | begin_layout() | Place new widgets in this Group |
void | end_layout() | Stop placing new widgets in this Group |
void | add(Widget o) | Add widget to group |
The Group class is the base FLTK container widget. It maintains an array of child widgets. These children can themselves be any widget including Group. The most important subclass of Group is Window; however groups can also be used to control radio buttons or to enforce resize behavior.
When you create any Group, it becomes the default container for new widgets, until you call group:end_layout(). As a convenience, End{} is a shortcut for this.
When you call delete() on any Group, all of its children are also deleted. This is convenient for deleting an entire Window at a time, but you should be careful not to reference subwidgets after their parent has been deleted.
begin_layout() sets this Group as the container that new widgets will be created in. begin_layout() is automatically called when you create any Group (including Windows). begin_layout() is exactly the same as Group.current = this.
Don't forget to call end_layout() on the group or window when you're done adding widgets!
end_layout() completes adding widgets to this
Group, and returns to adding widgets to the Group's
parent. Call this after you're finished building this group's
contents.
end_layout() is exactly the same as
Group.current = self.parent. Any new widgets added to the
widget tree will be added to the parent of the group.
Group.current is the current active Group. New widgets you
create are implicitly added to this group.
To prevent new widgets from being added to this group, set
Group.current = nil.
children is the number of child widgets currently contained
in this Group.
Returns the nth child widget contained in this Group,
counting from 0. Currently, no range checking is performed, so make
sure that 0 <= n < self.children.
Searches the child array for the widget and returns the index. Returns self.children if the widget is
nil or not found.
The widget is added to this group; if the widget is in another
Group, it is removed first.
Normally, you won't use this much; begin_layout() and
end_layout() are a simpler way of controlling where widgets
end up.
Group.current: Group
children: readonly integer
child(integer n): Widget
find(Widget w): integer
add(Widget o): void
remove(Widget o): void