public class Container extends Widget:
A container stores child widgets and optionally owns a layout.
layout = VBoxLayout(spacing=12)
root = Container.withLayout(layout)
root.padding = [16, 16, 16, 16]
root.setBounds(0, 0, 640, 480)
layout.add(Label("Name"))
layout.add(TextBox())
root.applyLayout()| Modifier and Type | Member | Description |
|---|---|---|
| public property | autoRelayoutautoRelayout as Boolean = true |
Enables automatic relayout when children are added or removed. |
| public property | layoutlayout as Object: |
Layout manager associated with this container. |
| public property | padding | Inner padding expressed as `(left, top, right, bottom)`. |
| public readonly property | sizesize as ULong: |
Number of child widgets. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | addadd(widget as Widget) as Void: |
No summary. |
| public | applyLayoutapplyLayout(recursive as Boolean = true) as Void: |
Applies the current layout and optionally recurses into child containers. |
| public | attachWindowattachWindow(window as Window) as Void: |
Propagates the owning window through the full subtree. |
| public | children | No summary. |
| public | clearclear() as Void: |
No summary. |
| public override | paintpaint(painter as Painter) as Void: |
Paints child widgets in insertion order. |
| public | remove | No summary. |
| public override | setBounds | No summary. |
| public static | withLayout | Creates a container already configured with a layout. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator[](index as UInt) as Widget: | No summary. |