TreeView
classin packageklyn.gui.windows
public class TreeView extends Widget:
└ TreeView

Focusable tree widget backed by a TreeModel.

root = TreeNode("Database", "DB", "root")
root.add(TreeNode("Tables", "[]", "group"))
tree = TreeView(TreeModel(root))
tree.nodeActivated += lambda(event: TreeNodeEvent): print(event.node.text)
Fields
Modifier and Type Member Description
public event nodeActivated
nodeActivated as TreeNodeEvent
Emitted when a node is activated by double-click or Enter.
Attributes inherited from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
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.
Properties inherited from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
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.
Methods inherited from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds