Container
classin packageklyn.gui.windows
public class Container extends Widget:
└ Container
A container stores child widgets and optionally owns a layout.
root = Container.withLayout(VBoxLayout(spacing=12))
root.padding = [16, 16, 16, 16]
root.setBounds(0, 0, 640, 480)
root.add(Label("Name"))
root.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 property layout
layout as Object = null
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)`.
public readonly property size
size as ULong:
Number of child widgets.
Properties inherited from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, styleClass, width, window, x, y
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 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.
Methods inherited from Widget: blur, containsPoint, paint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds
Operators
Modifier and Type Member Description
public operator[](index as UInt) as Widget: No summary.