Table of Contents

group

`group()` creates a titled container for related controls.

Constructor

group()

Creates a group object.

g = group().text("Settings").position(10, 10).size(300, 140);

Common Component Methods

Most visible GUI controls support these methods:

Method Returns Description
`position(x, y)` self Sets the component position in pixels.
`size(width, height)` self Sets component size in pixels. Width and height are clamped to at least 1.
`visible(enabled)` self Shows or hides the component.
`enabled(enabled)` self Enables or disables user interaction.

Common component properties:

Property Type Description
`position_x` number Current x position.
`position_y` number Current y position.
`size_width` number Current width.
`size_height` number Current height.
`visible` boolean Current visible state.
`enabled` boolean Current enabled state.

Methods

Method Returns Description
`text(label)` self Sets the group title text.
`border(enabled)` self Shows or hides the border.
`on_resize(callback)` self Sets callback called after resize.
`add(component)` self Adds a child GUI component.

Example

g = group().text("Settings").position(10, 10).size(300, 140);
g.add(togglebutton().position(12, 30).size(180, 24).text("Enabled"));
window().title("Group").size(340, 210).add(g).show();

Previous: panel

Next: splitpanel