Container
classin packageklyn.gui.windows
public class Container extends 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 Layout
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
propertyInherited Properties from Widget: accentColor, acceptFileDrops, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, 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
eventInherited Events from Widget: filesDropped, focusGained, focusLost, 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 Layout = 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 override blur
blur() as Void
Releases focus throughout this subtree, including descendants hidden by their container.
public children
children() as List<Widget>
No summary.
public clear
clear() as Void
Removes and detaches every child, releasing focus in their subtrees.
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
Removes a child and detaches its subtree from the owning window.
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 Layout) as Container
Creates a container already configured with a layout.
Inherited Methods
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFilesDropped, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintForeground, paintOverlay, preferredSizeIncludesContentZoom, 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.