Splitter
classin packageklyn.gui.windows
public class Splitter extends Container
└ Splitter

Two-pane resizable container.

A splitter lays out a first and second widget separated by a draggable handle. The handle position is exposed as a percentage through ratio, while the internal drag precision remains finer to keep resizing smooth. The native backend automatically displays the matching horizontal or vertical resize cursor while the pointer is over the handle. Setting either pane's isManaged or isVisible property to false collapses that pane; the remaining pane then fills the splitter and the handle is disabled.

left = TreeView()
right = TabWidget()
splitter = Splitter(Splitter.HORIZONTAL, left, right)
splitter.ratio = 30
right.isManaged = false
splitter.applyLayout()  # left now occupies the complete splitter
Fields
Modifier and Type Member Description
public const HORIZONTAL
HORIZONTAL as String = "horizontal"
Horizontal splitter: panes are arranged left/right.
public const VERTICAL
VERTICAL as String = "vertical"
Vertical splitter: panes are arranged top/bottom.
Properties
Modifier and Type Member Description
public property handleSize
handleSize as Int = 8
Draggable handle thickness in logical pixels, scaled with content zoom.
public property minimumFirstPaneSize
minimumFirstPaneSize as Int = 220
Minimum first-pane size in logical pixels, scaled with content zoom.
public property minimumSecondPaneSize
minimumSecondPaneSize as Int = 520
Minimum second-pane size in logical pixels, scaled with content zoom.
public property orientation
orientation as String
Split orientation, horizontal or vertical.
public property ratio
ratio as Int
Approximate first-pane percentage, clamped between 15 and 85.
Inherited Properties
propertyInherited Properties from Container: autoRelayout, childCount, layout, padding
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 Splitter
Splitter(orientation as String = Splitter.HORIZONTAL, first as Widget = null, second as Widget = null)
Creates a splitter with optional initial panes.
Methods
Modifier and Type Member Description
public override applyLayout
applyLayout(recursive as Boolean = true) as Void
No summary.
public beginDragAt
beginDragAt(x as Int, y as Int) as Boolean
Starts dragging the splitter handle when the pointer is over it.
public dragTo
dragTo(x as Int, y as Int) as Boolean
Moves the splitter handle during an active drag.
public endDrag
endDrag() as Void
Ends the current splitter drag.
public override paint
paint(painter as Painter) as Void
No summary.
public override paintOverlay
paintOverlay(painter as Painter) as Void
No summary.
public override setBounds
setBounds(x as Int, y as Int, width as Int, height as Int) as Void
No summary.
public setFirst
setFirst(widget as Widget) as Void
Replaces the first pane.
public setSecond
setSecond(widget as Widget) as Void
Replaces the second pane.
Inherited Methods
methodInherited Methods from Container: add, applyLayout, attachWindow, blur, children, clear, remove, withLayout
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
Inherited Operators
operatorInherited Operators from Container: operator[](index as Int) as Widget, operator[](index as UInt) as Widget