TreeView
class in package klyn.gui.windows

    public class TreeView extends Widget:

Widget
└ TreeView

Focusable tree widget backed by a `TreeModel`.

    import klyn.gui.windows
    import klyn.gui.windows.events

    root = TreeNode("Database", "DB", "root")
    root.add(TreeNode("Tables", "[]", "group"))
    tree = TreeView(TreeModel(root))
    tree.nodeActivated += lambda(event: TreeNodeEvent): print(event.node.text)

Properties

Modifier and Type | Member | Description
--- | --- | ---
public property | model `model as TreeModel:` | Tree model rendered by the widget.
public readonly property | selectedNode `selectedNode as TreeNode:` | Currently selected node, or `null` when nothing is selected.
public property | title `title as String = "Tree"` | Header text painted above the tree rows.

Inherited Properties
property Inherited Properties from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, 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
Events

Modifier and Type | Member | Description
--- | --- | ---
public event | nodeActivated `nodeActivated as TreeNodeEvent` | Emitted when a node is activated by double-click or Enter.
public event | nodeContextRequested `nodeContextRequested as TreeNodeContextEvent` | Emitted when a node receives a secondary-click context request.

Inherited Events
event Inherited Events from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | TreeView `TreeView(model as TreeModel = null):` | Creates a tree view with an optional model.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | paint `paint(painter as Painter) as Void:` | No summary.
public | refreshRows `refreshRows() as Void:` | Rebuilds the visible row cache after external code changed nodes.

Inherited Methods
method Inherited Methods from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds