ClearSelection | func (t *Tree) ClearSelection() *Tree | ClearSelection clears multi-selection. |
CollapseAll | func (t *Tree) CollapseAll() *Tree | CollapseAll collapses all nodes. |
ExpandAll | func (t *Tree) ExpandAll() *Tree | ExpandAll expands all nodes. |
ExpandTo | func (t *Tree) ExpandTo(depth int) *Tree | ExpandTo expands nodes to the specified depth. |
Filter | func (t *Tree) Filter(query string) *Tree | Filter filters the tree by a query string. |
GetSelected | func (t *Tree) GetSelected() *TreeNode | GetSelected returns the currently highlighted node. |
GetSelectedIndex | func (t *Tree) GetSelectedIndex() int | GetSelectedIndex returns the current cursor index in the flat node list. |
GetSelectedNodes | func (t *Tree) GetSelectedNodes() []*TreeNode | GetSelectedNodes returns all multi-selected nodes. |
SetIndentSize | func (t *Tree) SetIndentSize(size int) *Tree | SetIndentSize sets the indentation per level. |
SetLazyLoader | func (t *Tree) SetLazyLoader(fn func(node *TreeNode) []*TreeNode) *Tree | SetLazyLoader sets a function to load children on demand. |
SetMultiSelect | func (t *Tree) SetMultiSelect(enable bool) *Tree | SetMultiSelect enables/disables multi-selection. |
SetOnCollapse | func (t *Tree) SetOnCollapse(fn func(node *TreeNode)) *Tree | SetOnCollapse sets the callback for when a node is collapsed. |
SetOnExpand | func (t *Tree) SetOnExpand(fn func(node *TreeNode)) *Tree | SetOnExpand sets the callback for when a node is expanded. |
SetOnHighlight | func (t *Tree) SetOnHighlight(fn func(node *TreeNode)) *Tree | SetOnHighlight sets the callback for when the highlighted node changes (j/k navigation). |
SetOnSelect | func (t *Tree) SetOnSelect(fn func(node *TreeNode)) *Tree | SetOnSelect sets the callback for when a node is selected (Enter). |
SetRoot | func (t *Tree) SetRoot(root *TreeNode) *Tree | SetRoot sets the root node of the tree. |
SetSelectedIndex | func (t *Tree) SetSelectedIndex(index int) *Tree | SetSelectedIndex sets the cursor to the given index in the flat node list.
The index is clamped to valid bounds. onHighlight fires only when the index
actually changes. The scroll offset is adjusted so the new selection is
visible on the next draw. |
SetShowIcons | func (t *Tree) SetShowIcons(show bool) *Tree | SetShowIcons enables/disables node icons. |
SetShowLines | func (t *Tree) SetShowLines(show bool) *Tree | SetShowLines enables/disables tree line drawing. |