Container
class in package klyn.gui.windows

    public class Container extends Widget:

Widget
└ Container

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()

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | autoRelayout `autoRelayout as Boolean = true` | Enables automatic relayout when children are added or removed.
public readonly property | childCount `childCount as ULong:` | Number of child widgets owned by this container.
public property | layout `layout as Object:` | Layout manager associated with this container.
public property | padding `padding as IList<Int> = [0, 0, 0, 0]` | Inner padding expressed as `(left, top, right, bottom)`.

Inherited Properties
property Inherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Inherited Events
event Inherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | Container `Container(kmlFile as String):` | No summary.
public | Container `Container(layout as Object = null):` | No summary.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | add `add(widget as Widget) as Void:` | No summary.
public | applyLayout `applyLayout(recursive as Boolean = true) as Void:` | Applies the current layout and optionally recurses into child containers.
public | attachWindow `attachWindow(window as Window) as Void:` | Propagates the owning window through the full subtree.
public | children `children() as List<Widget>:` | No summary.
public | clear `clear() as Void:` | No summary.
public override | paint `paint(painter as Painter) as Void:` | Paints child widgets in insertion order.
public override | paintOverlay `paintOverlay(painter as Painter) as Void:` | Paints child overlays after the regular widget pass.
public | remove `remove(widget as Widget) as Boolean:` | No summary.
public override | setBounds `setBounds(x as Int, y as Int, width as Int, height as Int) as Void:` | No summary.
public static | withLayout `withLayout(layout as Object) as Container:` | Creates a container already configured with a layout.

Inherited Methods
method Inherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Operators

Modifier and Type | Member | Description
--- | --- | ---
public | operator[](index as Int) as Widget: | No summary.
public | operator[](index as UInt) as Widget: | No summary.