Container
classin packageklyn.gui.windows
public class Container extends Widget:
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 |
Enables automatic relayout when children are added or removed. |
| public property |
layout |
Layout manager associated with this container. |
| public property |
padding |
Inner padding expressed as `(left, top, right, bottom)`. |
| public readonly property |
size |
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 |
No summary. |
| public |
Container |
No summary. |
Methods
| 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 |
clear clear() as Void:
|
No summary. |
| public override |
paint |
Paints child widgets in insertion order. |
| public |
remove |
No summary. |
| public override |
setBoundssetBounds(x as Int, y as Int, width as Int, height as Int) as Void: |
No summary. |
| public static |
withLayout |
Creates a container already configured with a layout. |
Operators