A hierarchical, expandable tree. It reuses UIList's virtualization: the tree keeps a
mutable node model and flattens the currently-visible nodes (collapsed subtrees excluded)
into a flat array, which feeds the list as its provider. So a 100k-node tree still only
instantiates the handful of rows on screen, exactly like UIList.
Rows indent by depth and draw an expand/collapse chevron for parent nodes; clicking the
chevron toggles the branch, clicking elsewhere selects the row (Up/Down + Enter work through
the underlying list). Build the model with UITreeNodes and hand the roots to setRoots.
Constructor
new(width:Float, height:Float, rowHeight:Float = 0)
Parameters:
width | layout width |
|---|---|
height | visible viewport height |
rowHeight | base (unscaled) row height; 0 picks the platform default |
Variables
onActivate:UITreeNode ‑> Void = null
Fired on double click / Enter (leaves only; a parent toggles instead).
onNodeRightClick:(UITreeNode, Float, Float) ‑> Void = null
Fired on a right-click (or touch long-press) of a node, for a context menu. The node is
selected first, so selectedNode matches; the coordinates are in stage space.
Methods
setRoots(roots:Array<UITreeNode>):Void
Replaces the whole model and rebuilds the visible window.
Parameters:
roots | the top-level nodes |
|---|