fltk.group

FLTK Group/Container Class

This module provides the Group class that wraps FLTK's Fl_Group. Groups are container widgets that can hold child widgets.

The Group class provides:

  • Container for child widgets
  • Range-based iteration over children
  • Add/remove child operations
  • begin()/end() for automatic child assignment

    Authors

    Dejan Lekić

    License

    BSD-3-Clause
class Group

Types 1

classGroup : Widget

Container widget that can hold child widgets.

Groups are invisible containers that organize child widgets. They can be used for layout management and logical grouping.

Example:

auto group = new Group(0, 0, 200, 100);
group.begin();
// Widgets created here become children of group
auto button1 = new Button(10, 10, 80, 25, "One");
auto button2 = new Button(10, 40, 80, 25, "Two");
group.end();

// Iterate over children
foreach (child; group.children) {
   writeln("Child at: ", child.x, ", ", child.y);
}

Fields
GroupPtr _groupHandleThe underlying group handle
Methods
GroupPtr groupHandle() @safe nothrow @nogcReturns the underlying group handle.
void begin() nothrow @nogcBegins adding children to this group.
void end() nothrow @nogcEnds adding children to this group.
void add(Widget child) nothrow @nogcAdds a widget as a child of this group.
void remove(Widget child) nothrow @nogcRemoves a widget from this group.
int childCount() nothrow @nogcGets the number of child widgets.
Widget child(int index)Gets a child widget by index.
ChildRange children()Returns a range for iterating over child widgets.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new group widget.
this(GroupPtr handle, bool ownsHandle = false)Creates a Group wrapper around an existing handle.
Destructors
~thisDestroys the group and releases resources.
Nested Templates
ChildRangeRange type for iterating over child widgets.