Tree displays a hierarchy of tree nodes which can be expanded and collapsed.
Slots
- borderSource
-
const Bool border := true
Draw a border around the widget. Default is true. This field cannot be changed once the widget is constructed.
- modelSource
-
TreeModel model
Backing data model of tree.
- multiSource
-
const Bool multi := false
True to enable multi-node selection, false for single node selection. Default is false. This field cannot be changed once the widget is constructed.
- onActionSource
-
readonly EventListeners onAction := EventListeners()
Callback when node is double clicked or Return/Enter key is pressed.
Event id fired:
Event fields:
Event.data
: theTreeModel
node object
- onPopupSource
-
readonly EventListeners onPopup := EventListeners()
Callback when user invokes a right click popup action. If the callback wishes to display a popup, then set the
Event.popup
field with menu to open. If multiple callbacks are installed, the first one to return a nonnull popup consumes the event.Event id fired:
Event fields:
Event.data
: the primary selection node object, ornull
if this is a background popup.
- onSelectSource
-
readonly EventListeners onSelect := EventListeners()
Callback when selected nodes change.
Event id fired:
Event fields:
Event.data
: the primary selection node object.
- refreshAllSource
-
native Void refreshAll()
Update the entire tree's contents from the model.
- refreshNodeSource
-
native Void refreshNode(Obj node)
Update the specified node from the model.
- selectSource
-
Select the given item in the tree.
- selectedSource
-
native Obj[] selected
Get and set the selected nodes.
- setExpandedSource
-
native Void setExpanded(Obj node, Bool expanded)
Set the expanded state for this node.
- showSource
-
Shows the node. If the node is already showing in the tree, this method simply returns. Otherwise, the items are scrolled and expanded until the node is visible