ScrollPane
classin packageklyn.gui.windows
public class ScrollPane extends Container:
└ ScrollPane

Clipped viewport for a vertically scrollable widget hierarchy.

The pane keeps ordinary child widgets fully interactive while translating its content container. The mouse wheel, the scrollbar track and direct thumb dragging all update the same scroll offset.

pane = ScrollPane(VBoxLayout(spacing=8))
pane.addContent(Label("First row"))
pane.addContent(Label("Second row"))
pane.contentHeight = 400
window.centralWidget.add(pane)
Properties
Modifier and Type Member Description
public readonly property content
content as Container:
Container translated inside the viewport.
public property contentHeight
contentHeight as Int:
Full vertical extent of the scrollable content in pixels.
public property scrollOffset
scrollOffset as Int:
Current vertical offset in pixels.
public property scrollStep
scrollStep as Int = 44
Number of pixels moved for one normalized wheel step.
public property scrollbarWidth
scrollbarWidth as Int = 10
Width reserved for the vertical scrollbar.
Inherited Properties
propertyInherited Properties from Container: autoRelayout, childCount, layout, padding
propertyInherited Properties from Widget: accentColor, 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: focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public ScrollPane
ScrollPane(contentLayout as Layout = null):
Creates a pane whose content optionally uses a layout manager.
Methods
Modifier and Type Member Description
public addContent
addContent(widget as Widget) as Void:
Adds an interactive widget to the scrollable content.
public clearContent
clearContent() as Void:
Removes all widgets from the scrollable content and resets the viewport.
public override paint
paint(painter as Painter) as Void:
No summary.
public scrollBy
scrollBy(delta as Int) as Boolean:
Scrolls by a signed pixel distance and returns whether the view moved.
public override setBounds
setBounds(x as Int, y as Int, width as Int, height as Int) as Void:
No summary.
Inherited Methods
methodInherited Methods from Container: add, applyLayout, attachWindow, children, clear, paintOverlay, remove, withLayout
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, 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: