Tree
Hierarchical list with columns and TreeItem rows.
Tree is a UI control for hierarchies and tables. Its TreeItem rows are not Entity objects and do not belong to the Entity hierarchy. Set Columns first, then create the root with CreateItem(). Subsequent CreateItem() calls without parent create children of that root. For a flat list, enable HideRoot: the structural root remains, while its children are displayed.
Use SetText(column, text) for row labels. Column indices start at 0. Store a model identifier with SetMetadata rather than using display text or the current row index: labels and order can change. Programmatic SetText emits no ItemEdited; update your model explicitly.
Tree owns its attached TreeItem objects. Clear immediately frees the root and all descendants; freeing Tree also deletes its rows. Retained references become invalid. Before rebuilding, retain any model identifiers you need, recreate the rows, and restore state by identifier.
RemoveChild detaches a subtree without deleting it. Either adopt it through another TreeItem’s AddChild or explicitly Free it. Moving between trees with different Columns discards trailing cell data. Creating rows, Clear and changing Columns are blocked during mouse selection processing: defer rebuilding until the handler has completed.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TreeConstructor
public Tree();Creates an empty Tree with one column and no root. Create the root through CreateItem.
Properties16
AllowReselectProperty
public bool AllowReselect { get; set; }Allows repeat notification when the selection path chooses an already selected cell/row. Does not enable Multi or make programmatic TreeItem.Select emit signals in Multi.
AllowRmbSelectProperty
public bool AllowRmbSelect { get; set; }Allows right-mouse selection of a row. This is an input policy: it does not open a context menu, change SelectMode or restrict programmatic selection.
AllowSearchProperty
public bool AllowSearch { get; set; }Allows keyboard prefix search against original labels, ignoring case. Navigates rows rather than filtering data or creating a search box. In Multi, search moves only the cursor without adding to selection. gui/timers/incremental_search_max_interval_msec controls the typing interval.
AutoTooltipProperty
public bool AutoTooltip { get; set; }Use the cell label/value as a tooltip when no explicit tooltip is set. Does not generate an accessibility description or replace action-button tooltips. Set false to disable this fallback; clearing the row’s explicit tooltip alone is insufficient.
ColumnTitlesVisibleProperty
public bool ColumnTitlesVisible { get; set; }Shows column headers, default false. Prefer setting this before populating or measuring columns. Limitation: showing headers dynamically after GetColumnWidth can retain stale cached widths. To recompute, retain each column’s IsColumnClippingContent, set SetColumnClipContent to the opposite value, then restore it.
ColumnsProperty
public int Columns { get; set; }Column count, at least 1; default 1. Set before populating. Reducing it discards trailing cell data throughout the tree. Changes are blocked during mouse selection processing.
DropModeFlagsProperty
public int DropModeFlags { get; set; }Drop-target zones: 0 disables them, OnItem (1) targets a row, Inbetween (2) targets between rows, and 3 enables both. Controls target calculation/highlighting rather than data transfer. Implement validation and model changes in drag-and-drop handlers; account for SetAcceptChildren and prevent cycles.
EnableDragUnfoldingProperty
public bool EnableDragUnfolding { get; set; }Allows a branch to unfold after a dragged item hovers over it. Does not create drag data or transfer the model. Disabling stops a pending unfolding timer.
EnableRecursiveFoldingProperty
public bool EnableRecursiveFolding { get; set; }Allows recursive folding/unfolding through the user Shift gesture. Does not block SetCollapsedRecursive from code.
HideFoldingProperty
public bool HideFolding { get; set; }Hides normal folding controls throughout Tree. Does not expand branches or block programmatic Collapsed/SetCollapsedRecursive. Configure branch states separately.
HideRootProperty
public bool HideRoot { get; set; }Hides the root’s presentation while retaining the root and its children. Useful for a flat list with a shared hidden parent. Does not delete a row or change GetRoot.
ScrollHintModeProperty
public Tree.ScrollHintModeEnum ScrollHintMode { get; set; }Configures visual hints for content hidden above/below: Disabled, Both, Top or Bottom. Does not enable scrolling or change its amount.
ScrollHorizontalEnabledProperty
public bool ScrollHorizontalEnabled { get; set; }Enables horizontal scrolling. With false, Tree’s minimum width includes content, so a container can expand the control. Does not fix column widths or control vertical scrolling.
ScrollVerticalEnabledProperty
public bool ScrollVerticalEnabled { get; set; }Enables vertical scrolling. With false, Tree’s minimum height includes content, so a container can expand the control. Configure horizontal scrolling separately.
SelectModeProperty
public Tree.SelectModeEnum SelectMode { get; set; }Single selects one cell, Row selects the selectable cells of one row, and Multi allows accumulated selection. Changing modes neither clears nor normalizes existing flags: call DeselectAll before switching. In Multi, the GetSelected cursor is not the full selection.
TileScrollHintProperty
public bool TileScrollHint { get; set; }Tile the scroll-hint texture rather than stretching it. This styles the hint rather than enabling cyclic list scrolling.
Methods73
AreColumnTitlesVisiblebool
public bool AreColumnTitlesVisible();Shows column headers, default false. Prefer setting this before populating or measuring columns. Limitation: showing headers dynamically after GetColumnWidth can retain stale cached widths. To recompute, retain each column’s IsColumnClippingContent, set SetColumnClipContent to the opposite value, then restore it.
boolShows column headers, default false. Prefer setting this before populating or measuring columns. Limitation: showing headers dynamically after GetColumnWidth can retain stale cached widths. To recompute, retain each column’s IsColumnClippingContent, set SetColumnClipContent to the opposite value, then restore it.
Clearvoid
public void Clear();Immediately deletes the root and all attached rows and resets selected and edited items. Old references become invalid. Previously detached subtrees are not deleted. Blocked during mouse selection processing.
CreateItemTreeItem
public TreeItem CreateItem(TreeItem parent = null, int index = -1);Without parent, the first call creates the root and later calls create its children. With parent, creates a child of that row in this Tree. index < 0 appends; an existing child index inserts before it. Cannot run during mouse selection processing.
| Name | Type | Default |
|---|---|---|
parent | TreeItem | null |
index | int | -1 |
parentParent in this same Tree; null uses the CreateItem root rules.
indexStructural child index. During creation a negative value appends; for GetChild a negative value counts from the end.
TreeItemWithout parent, the first call creates the root and later calls create its children. With parent, creates a child of that row in this Tree. index < 0 appends; an existing child index inserts before it. Cannot run during mouse selection processing.
DeselectAllvoid
public void DeselectAll();Clears selection throughout the tree and resets the cursor: GetSelected is null and GetSelectedColumn is -1. Emits no CellSelected, ItemSelected or MultiSelected. Explicitly update the model if it must react to a programmatic reset.
EditSelected2 overloads
public bool EditSelected();Starts the editing action for the GetSelected/GetSelectedColumn cursor cell. First check that a row exists and belongs to Tree. Editable is required without forceEdit. Check immediately toggles checked and emits ItemEdited; Custom requests an application editor and also emits ItemEdited before the application changes the value. String/Range can open a built-in editor; Icon has no editor. true means a handled action/editor start rather than a guaranteed value commit. The no-argument overload uses false.
boolStarts the editing action for the GetSelected/GetSelectedColumn cursor cell. First check that a row exists and belongs to Tree. Editable is required without forceEdit. Check immediately toggles checked and emits ItemEdited; Custom requests an application editor and also emits ItemEdited before the application changes the value. String/Range can open a built-in editor; Icon has no editor. true means a handled action/editor start rather than a guaranteed value commit. The no-argument overload uses false.
public bool EditSelected(bool forceEdit = false);Starts the editing action for the GetSelected/GetSelectedColumn cursor cell. First check that a row exists and belongs to Tree. Editable is required without forceEdit. Check immediately toggles checked and emits ItemEdited; Custom requests an application editor and also emits ItemEdited before the application changes the value. String/Range can open a built-in editor; Icon has no editor. true means a handled action/editor start rather than a guaranteed value commit. The no-argument overload uses false.
| Name | Type | Default |
|---|---|---|
forceEdit | bool | false |
forceEditAllow the action even with Editable false; does not force a new value to be committed.
boolStarts the editing action for the GetSelected/GetSelectedColumn cursor cell. First check that a row exists and belongs to Tree. Editable is required without forceEdit. Check immediately toggles checked and emits ItemEdited; Custom requests an application editor and also emits ItemEdited before the application changes the value. String/Range can open a built-in editor; Icon has no editor. true means a handled action/editor start rather than a guaranteed value commit. The no-argument overload uses false.
EnsureCursorIsVisiblevoid
public void EnsureCursorIsVisible();Scrolls to the current cursor cell. Does nothing without a cursor and does not collect or reveal the entire Multi selection. Part of the update can be deferred to the next frame. Does not expand ancestors or enable Visible.
GetAllowReselectbool
public bool GetAllowReselect();Allows repeat notification when the selection path chooses an already selected cell/row. Does not enable Multi or make programmatic TreeItem.Select emit signals in Multi.
boolAllows repeat notification when the selection path chooses an already selected cell/row. Does not enable Multi or make programmatic TreeItem.Select emit signals in Multi.
GetAllowRmbSelectbool
public bool GetAllowRmbSelect();Allows right-mouse selection of a row. This is an input policy: it does not open a context menu, change SelectMode or restrict programmatic selection.
boolAllows right-mouse selection of a row. This is an input policy: it does not open a context menu, change SelectMode or restrict programmatic selection.
GetAllowSearchbool
public bool GetAllowSearch();Allows keyboard prefix search against original labels, ignoring case. Navigates rows rather than filtering data or creating a search box. In Multi, search moves only the cursor without adding to selection. gui/timers/incremental_search_max_interval_msec controls the typing interval.
boolAllows keyboard prefix search against original labels, ignoring case. Navigates rows rather than filtering data or creating a search box. In Multi, search moves only the cursor without adding to selection. gui/timers/incremental_search_max_interval_msec controls the typing interval.
GetButtonIdAtPositionint
public int GetButtonIdAtPosition(Vector2 position);Button ID at a Tree-local position, or -1 when there is no hit. Coordinates are neither screen-space nor TreeItem-local. Returns an ID rather than an index and depends on the current row layout.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
positionPosition in Tree control-local coordinates.
intButton ID at a Tree-local position, or -1 when there is no hit. Coordinates are neither screen-space nor TreeItem-local. Returns an ID rather than an index and depends on the current row layout.
GetColumnAtPositionint
public int GetColumnAtPosition(Vector2 position);Column index under a row at a Tree-local position; -1 when no matching row exists. Searches content rather than serving as a universal header hit-test.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
positionPosition in Tree control-local coordinates.
intColumn index under a row at a Tree-local position; -1 when no matching row exists. Searches content rather than serving as a universal header hit-test.
GetColumnExpandRatioint
public int GetColumnExpandRatio(int column);Stored integer expansion weight rather than a width percentage or the ratio of final column sizes.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
intStored integer expansion weight rather than a width percentage or the ratio of final column sizes.
GetColumnTitlestring
public string GetColumnTitle(int column);Original column-title string rather than its automatically translated presentation.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
stringOriginal column-title string rather than its automatically translated presentation.
GetColumnTitleAlignmentHorizontalAlignment
public HorizontalAlignment GetColumnTitleAlignment(int column);Stored header alignment, default Center. Data-row cell settings are independent.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
HorizontalAlignmentStored header alignment, default Center. Data-row cell settings are independent.
GetColumnTitleDirectionControl.TextDirection
public Control.TextDirection GetColumnTitleDirection(int column);Stored header text direction. Inherited means inheritance from Tree rather than an already resolved direction.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
Control.TextDirectionStored header text direction. Inherited means inheritance from Tree rather than an already resolved direction.
GetColumnTitleLanguagestring
public string GetColumnTitleLanguage(int column);Stored header shaping-language hint rather than the current application locale.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
stringStored header shaping-language hint rather than the current application locale.
GetColumnTitleTooltipTextstring
public string GetColumnTitleTooltipText(int column);Stored explicit header tooltip; an empty string does not imply that every Control tooltip is disabled.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
stringStored explicit header tooltip; an empty string does not imply that every Control tooltip is disabled.
GetColumnWidthint
public int GetColumnWidth(int column);Current computed column width: its minimum plus a share of spare space when Expand is enabled. Depends on Tree size, theme, visible rows and title; need not equal CustomMinimumWidth. Query after configuring size and content.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
intCurrent computed column width: its minimum plus a share of spare space when Expand is enabled. Depends on Tree size, theme, visible rows and title; need not equal CustomMinimumWidth. Query after configuring size and content.
GetColumnsint
public int GetColumns();Column count, at least 1; default 1. Set before populating. Reducing it discards trailing cell data throughout the tree. Changes are blocked during mouse selection processing.
intColumn count, at least 1; default 1. Set before populating. Reducing it discards trailing cell data throughout the tree. Changes are blocked during mouse selection processing.
GetCustomDrawingCanvasItemRid
public Rid GetCustomDrawingCanvasItem();Returns the Tree-owned RID for custom drawing inside a cell callback. Do not free it through RenderingServer or use it after Tree is freed. This is not a separate CanvasItem Entity or permission to draw outside the drawing cycle.
RidReturns the Tree-owned RID for custom drawing inside a cell callback. Do not free it through RenderingServer or use it after Tree is freed. This is not a separate CanvasItem Entity or permission to draw outside the drawing cycle.
GetCustomPopupRectRect2
public Rect2 GetCustomPopupRect();Last placement area for a Custom application editor, in Tree UI-global coordinates. Not automatically screen coordinates for an external Window; account for CanvasLayer, transforms and window embedding. Read during CustomPopupEdited after current layout, not as persistent row geometry.
Rect2Last placement area for a Custom application editor, in Tree UI-global coordinates. Not automatically screen coordinates for an external Window; account for CanvasLayer, transforms and window embedding. Read during CustomPopupEdited after current layout, not as persistent row geometry.
GetDropModeFlagsint
public int GetDropModeFlags();Drop-target zones: 0 disables them, OnItem (1) targets a row, Inbetween (2) targets between rows, and 3 enables both. Controls target calculation/highlighting rather than data transfer. Implement validation and model changes in drag-and-drop handlers; account for SetAcceptChildren and prevent cycles.
intDrop-target zones: 0 disables them, OnItem (1) targets a row, Inbetween (2) targets between rows, and 3 enables both. Controls target calculation/highlighting rather than data transfer. Implement validation and model changes in drag-and-drop handlers; account for SetAcceptChildren and prevent cycles.
GetDropSectionAtPositionint
public int GetDropSectionAtPosition(Vector2 position);Drop zone at a Tree-local position: -100 means no target, -1 a sibling above, 0 on the row/as last child, 1 a sibling below, and 2 the first child of an existing branch. Combined zones do use 2; do not restrict handlers to -1/0/1. Requires enabled DropModeFlags; the result does not validate model data.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
positionPosition in Tree control-local coordinates.
intDrop zone at a Tree-local position: -100 means no target, -1 a sibling above, 0 on the row/as last child, 1 a sibling below, and 2 the first child of an existing branch. Combined zones do use 2; do not restrict handlers to -1/0/1. Requires enabled DropModeFlags; the result does not validate model data.
GetEditedTreeItem
public TreeItem GetEdited();Row of the last editing context, or null after clearing/removal. Need not equal GetSelected. In Custom, context is set when the application editor is requested. Check this reference before using GetEditedColumn.
TreeItemRow of the last editing context, or null after clearing/removal. Need not equal GetSelected. In Custom, context is set when the application editor is requested. Check this reference before using GetEditedColumn.
GetEditedColumnint
public int GetEditedColumn();Column of the last editing context rather than the current cursor. Clear resets GetEdited but can retain the previous column number. Use it only with a non-null valid GetEdited and the current Columns.
intColumn of the last editing context rather than the current cursor. Clear resets GetEdited but can retain the previous column number. Use it only with a non-null valid GetEdited and the current Columns.
GetItemAreaRectRect2
public Rect2 GetItemAreaRect(TreeItem item, int column = -1, int buttonIndex = -1);Computed row area in Tree-local coordinates; column -1 means the full row, otherwise one column. For buttonIndex, supply a column and a nonnegative button index rather than an ID. Requires a row in this Tree. The result does not guarantee viewport visibility; first restore the needed visibility and layout for hidden/collapsed branches.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
column | int | -1 |
buttonIndex | int | -1 |
itemValid row belonging to this Tree.
columnColumn, or -1 for the entire row.
buttonIndexNonnegative button index rather than an ID; -1 for the ordinary row/cell area.
Rect2Computed row area in Tree-local coordinates; column -1 means the full row, otherwise one column. For buttonIndex, supply a column and a nonnegative button index rather than an ID. Requires a row in this Tree. The result does not guarantee viewport visibility; first restore the needed visibility and layout for hidden/collapsed branches.
GetItemAtPositionTreeItem
public TreeItem GetItemAtPosition(Vector2 position);Row at a Tree-local position, or null when no row is found. Accounts for current scrolling and layout; pass control-local rather than screen coordinates. The returned row belongs to Tree.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
positionPosition in Tree control-local coordinates.
TreeItemRow at a Tree-local position, or null when no row is found. Accounts for current scrolling and layout; pass control-local rather than screen coordinates. The returned row belongs to Tree.
GetNextSelectedTreeItem
public TreeItem GetNextSelected(TreeItem from);Returns the next row with a stored selected flag in at least one column. Start with null, then pass the previous result; null ends iteration. Uses structural order, including a hidden root and collapsed branches. Reads retained flags even when Selectable is false; additionally check IsSelected per column for selectable selected cells.
| Name | Type | Default |
|---|---|---|
from | TreeItem | — |
fromPreviously found row; null begins iteration at the root.
TreeItemReturns the next row with a stored selected flag in at least one column. Start with null, then pass the previous result; null ends iteration. Uses structural order, including a hidden root and collapsed branches. Reads retained flags even when Selectable is false; additionally check IsSelected per column for selectable selected cells.
GetPressedButtonint
public int GetPressedButton();Stored button index from the last processed press, or -1. This is a column-local index rather than a command ID or a universal held-down test. Use the ButtonClicked id for command handling.
intStored button index from the last processed press, or -1. This is a column-local index rather than a command ID or a universal held-down test. Use the ButtonClicked id for command handling.
GetRootTreeItem
public TreeItem GetRoot();Returns the structural root even when HideRoot is true; null before the first CreateItem and after Clear. The result belongs to Tree.
TreeItemReturns the structural root even when HideRoot is true; null before the first CreateItem and after Clear. The result belongs to Tree.
GetScrollVector2
public Vector2 GetScroll();Current pixel scroll offset. Returns 0 on an axis whose scrollbar is not visible. Not the Tree position or the index of the first visible row.
Vector2Current pixel scroll offset. Returns 0 on an axis whose scrollbar is not visible. Not the Tree position or the index of the first visible row.
GetScrollHintModeTree.ScrollHintModeEnum
public Tree.ScrollHintModeEnum GetScrollHintMode();Configures visual hints for content hidden above/below: Disabled, Both, Top or Bottom. Does not enable scrolling or change its amount.
Tree.ScrollHintModeEnumConfigures visual hints for content hidden above/below: Disabled, Both, Top or Bottom. Does not enable scrolling or change its amount.
GetSelectModeTree.SelectModeEnum
public Tree.SelectModeEnum GetSelectMode();Single selects one cell, Row selects the selectable cells of one row, and Multi allows accumulated selection. Changing modes neither clears nor normalizes existing flags: call DeselectAll before switching. In Multi, the GetSelected cursor is not the full selection.
Tree.SelectModeEnumSingle selects one cell, Row selects the selectable cells of one row, and Multi allows accumulated selection. Changing modes neither clears nor normalizes existing flags: call DeselectAll before switching. In Multi, the GetSelected cursor is not the full selection.
GetSelectedTreeItem
public TreeItem GetSelected();Returns the current cursor row or null. In Multi, selection can exist without a cursor, and the cursor can remain on a deselected cell. Enumerate GetNextSelected for selected rows. The result belongs to Tree.
TreeItemReturns the current cursor row or null. In Multi, selection can exist without a cursor, and the cursor can remain on a deselected cell. Enumerate GetNextSelected for selected rows. The result belongs to Tree.
GetSelectedColumnint
public int GetSelectedColumn();Current cursor column; -1 after DeselectAll. In Multi it neither enumerates selected columns nor guarantees IsSelected for the cursor cell.
intCurrent cursor column; -1 after DeselectAll. In Multi it neither enumerates selected columns nor guarantees IsSelected for the cursor cell.
IsAutoTooltipEnabledbool
public bool IsAutoTooltipEnabled();Use the cell label/value as a tooltip when no explicit tooltip is set. Does not generate an accessibility description or replace action-button tooltips. Set false to disable this fallback; clearing the row’s explicit tooltip alone is insufficient.
boolUse the cell label/value as a tooltip when no explicit tooltip is set. Does not generate an accessibility description or replace action-button tooltips. Set false to disable this fallback; clearing the row’s explicit tooltip alone is insufficient.
IsColumnClippingContentbool
public bool IsColumnClippingContent(int column);Configured policy for excluding row content from minimum-width calculation. Does not report whether a particular label is currently clipped.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
boolConfigured policy for excluding row content from minimum-width calculation. Does not report whether a particular label is currently clipped.
IsColumnExpandingbool
public bool IsColumnExpanding(int column);Whether the column participates in spare-space distribution. This is expansion permission rather than proof that spare space currently exists.
| Name | Type | Default |
|---|---|---|
column | int | — |
columnColumn index from 0 through Columns - 1.
boolWhether the column participates in spare-space distribution. This is expansion permission rather than proof that spare space currently exists.
IsDragUnfoldingEnabledbool
public bool IsDragUnfoldingEnabled();Allows a branch to unfold after a dragged item hovers over it. Does not create drag data or transfer the model. Disabling stops a pending unfolding timer.
boolAllows a branch to unfold after a dragged item hovers over it. Does not create drag data or transfer the model. Disabling stops a pending unfolding timer.
public bool IsFoldingHidden();Hides normal folding controls throughout Tree. Does not expand branches or block programmatic Collapsed/SetCollapsedRecursive. Configure branch states separately.
boolHides normal folding controls throughout Tree. Does not expand branches or block programmatic Collapsed/SetCollapsedRecursive. Configure branch states separately.
IsHScrollEnabledbool
public bool IsHScrollEnabled();Enables horizontal scrolling. With false, Tree’s minimum width includes content, so a container can expand the control. Does not fix column widths or control vertical scrolling.
boolEnables horizontal scrolling. With false, Tree’s minimum width includes content, so a container can expand the control. Does not fix column widths or control vertical scrolling.
IsRecursiveFoldingEnabledbool
public bool IsRecursiveFoldingEnabled();Allows recursive folding/unfolding through the user Shift gesture. Does not block SetCollapsedRecursive from code.
boolAllows recursive folding/unfolding through the user Shift gesture. Does not block SetCollapsedRecursive from code.
public bool IsRootHidden();Hides the root’s presentation while retaining the root and its children. Useful for a flat list with a shared hidden parent. Does not delete a row or change GetRoot.
boolHides the root’s presentation while retaining the root and its children. Useful for a flat list with a shared hidden parent. Does not delete a row or change GetRoot.
IsScrollHintTiledbool
public bool IsScrollHintTiled();Tile the scroll-hint texture rather than stretching it. This styles the hint rather than enabling cyclic list scrolling.
boolTile the scroll-hint texture rather than stretching it. This styles the hint rather than enabling cyclic list scrolling.
IsVScrollEnabledbool
public bool IsVScrollEnabled();Enables vertical scrolling. With false, Tree’s minimum height includes content, so a container can expand the control. Configure horizontal scrolling separately.
boolEnables vertical scrolling. With false, Tree’s minimum height includes content, so a container can expand the control. Configure horizontal scrolling separately.
ScrollToItemvoid
public void ScrollToItem(TreeItem item, bool centerOnItem = false);Scrolls to a row without selecting it or expanding its parents. item must belong to this Tree. Expand the required ancestor chain and configure control size first; centerOnItem attempts vertical centering within the available scroll range.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
centerOnItem | bool | false |
itemValid row belonging to this Tree.
centerOnItemAttempt to center the row vertically; does not change selection.
SetAllowReselectvoid
public void SetAllowReselect(bool allow);Allows repeat notification when the selection path chooses an already selected cell/row. Does not enable Multi or make programmatic TreeItem.Select emit signals in Multi.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowEnable the corresponding reselection or right-mouse policy.
SetAllowRmbSelectvoid
public void SetAllowRmbSelect(bool allow);Allows right-mouse selection of a row. This is an input policy: it does not open a context menu, change SelectMode or restrict programmatic selection.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowEnable the corresponding reselection or right-mouse policy.
SetAllowSearchvoid
public void SetAllowSearch(bool allow);Allows keyboard prefix search against original labels, ignoring case. Navigates rows rather than filtering data or creating a search box. In Multi, search moves only the cursor without adding to selection. gui/timers/incremental_search_max_interval_msec controls the typing interval.
| Name | Type | Default |
|---|---|---|
allow | bool | — |
allowAllow keyboard search/navigation without filtering rows.
SetAutoTooltipvoid
public void SetAutoTooltip(bool enable);Use the cell label/value as a tooltip when no explicit tooltip is set. Does not generate an accessibility description or replace action-button tooltips. Set false to disable this fallback; clearing the row’s explicit tooltip alone is insufficient.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableAutomatic tooltip from the cell value when no explicit tooltip exists.
SetColumnClipContentvoid
public void SetColumnClipContent(int column, bool enable);Allows row content to be omitted when computing the column’s minimum width. Does not exclude a visible title’s minimum or disable Expand. With false, full text width contributes only for cells using TextOverrunBehavior = NoTrimming; trimmable text does not itself force the column to fit the entire label.
| Name | Type | Default |
|---|---|---|
column | int | — |
enable | bool | — |
columnColumn index from 0 through Columns - 1.
enableExclude row content from minimum-width computation.
SetColumnCustomMinimumWidthvoid
public void SetColumnCustomMinimumWidth(int column, int minWidth);Sets a nonnegative column-width minimum in pixels rather than a fixed width. Titles, content and Expand can make it wider. Negative values are ignored; 0 removes the local minimum. For a constrained-width column, also disable Expand and configure ClipContent.
| Name | Type | Default |
|---|---|---|
column | int | — |
minWidth | int | — |
columnColumn index from 0 through Columns - 1.
minWidthNonnegative pixel minimum; 0 removes the local minimum and negative values are ignored.
SetColumnExpandvoid
public void SetColumnExpand(int column, bool expand);Allows the column to receive spare space beyond its minimum; default true. false retains its computed minimum rather than forcing content into an arbitrary pixel width.
| Name | Type | Default |
|---|---|---|
column | int | — |
expand | bool | — |
columnColumn index from 0 through Columns - 1.
expandAllow spare-space allocation to this column.
SetColumnExpandRatiovoid
public void SetColumnExpandRatio(int column, int ratio);Sets an expanding column’s relative weight, default 1. A 1:2 ratio divides extra space rather than total widths. Use positive integers: zero and negative values are stored without validation and can produce undesirable sizing. Has no effect when Expand is false.
| Name | Type | Default |
|---|---|---|
column | int | — |
ratio | int | — |
columnColumn index from 0 through Columns - 1.
ratioPositive integer weight for extra width.
SetColumnTitlevoid
public void SetColumnTitle(int column, string title);Sets the original column title and updates its text measurement. Presentation uses Tree translation; GetColumnTitle retains the source string. The setter neither shows headers nor sorts rows.
| Name | Type | Default |
|---|---|---|
column | int | — |
title | string | — |
columnColumn index from 0 through Columns - 1.
titleOriginal title; add it to the application catalog for translation.
SetColumnTitleAlignmentvoid
public void SetColumnTitleAlignment(int column, HorizontalAlignment titleAlignment);Aligns header text: Left, Center or Right. Fill is unsupported and produces a warning; do not use it. Does not change text direction or alignment in data rows.
| Name | Type | Default |
|---|---|---|
column | int | — |
titleAlignment | HorizontalAlignment | — |
columnColumn index from 0 through Columns - 1.
titleAlignmentLeft, Center or Right; Fill is unsupported.
SetColumnTitleDirectionvoid
public void SetColumnTitleDirection(int column, Control.TextDirection direction);Sets the header’s base text direction. Inherited follows the Tree layout. Does not change original GetColumnTitle, column order or text direction in data rows.
| Name | Type | Default |
|---|---|---|
column | int | — |
direction | Control.TextDirection | — |
columnColumn index from 0 through Columns - 1.
directionHeader base text direction.
SetColumnTitleLanguagevoid
public void SetColumnTitleLanguage(int column, string language);Header text-shaping language hint, such as ar. An empty string uses the default locale. Does not translate text or switch the application language.
| Name | Type | Default |
|---|---|---|
column | int | — |
language | string | — |
columnColumn index from 0 through Columns - 1.
languageText-shaping language hint rather than a title translation.
SetColumnTitleTooltipTextvoid
public void SetColumnTitleTooltipText(int column, string tooltipText);Sets an explicit header tooltip, separate from cell and button tooltips. An empty string falls back to the Control’s tooltip behavior.
| Name | Type | Default |
|---|---|---|
column | int | — |
tooltipText | string | — |
columnColumn index from 0 through Columns - 1.
tooltipTextExplicit header tooltip, or an empty string for Control behavior.
SetColumnTitlesVisiblevoid
public void SetColumnTitlesVisible(bool visible);Shows column headers, default false. Prefer setting this before populating or measuring columns. Limitation: showing headers dynamically after GetColumnWidth can retain stale cached widths. To recompute, retain each column’s IsColumnClippingContent, set SetColumnClipContent to the opposite value, then restore it.
| Name | Type | Default |
|---|---|---|
visible | bool | — |
visibleShow headers; account for cached measured widths when changing dynamically.
SetColumnsvoid
public void SetColumns(int amount);Column count, at least 1; default 1. Set before populating. Reducing it discards trailing cell data throughout the tree. Changes are blocked during mouse selection processing.
| Name | Type | Default |
|---|---|---|
amount | int | — |
amountNew column count, at least 1.
SetDropModeFlagsvoid
public void SetDropModeFlags(int flags);Drop-target zones: 0 disables them, OnItem (1) targets a row, Inbetween (2) targets between rows, and 3 enables both. Controls target calculation/highlighting rather than data transfer. Implement validation and model changes in drag-and-drop handlers; account for SetAcceptChildren and prevent cycles.
| Name | Type | Default |
|---|---|---|
flags | int | — |
flags0, OnItem (1), Inbetween (2), or their combination 3.
SetEnableDragUnfoldingvoid
public void SetEnableDragUnfolding(bool enable);Allows a branch to unfold after a dragged item hovers over it. Does not create drag data or transfer the model. Disabling stops a pending unfolding timer.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableAllow branch unfolding while a dragged item hovers over it.
SetEnableRecursiveFoldingvoid
public void SetEnableRecursiveFolding(bool enable);Allows recursive folding/unfolding through the user Shift gesture. Does not block SetCollapsedRecursive from code.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableAllow the recursive folding gesture.
SetHScrollEnabledvoid
public void SetHScrollEnabled(bool hScroll);Enables horizontal scrolling. With false, Tree’s minimum width includes content, so a container can expand the control. Does not fix column widths or control vertical scrolling.
| Name | Type | Default |
|---|---|---|
hScroll | bool | — |
hScrollEnable horizontal scrolling.
SetHideFoldingvoid
public void SetHideFolding(bool hide);Hides normal folding controls throughout Tree. Does not expand branches or block programmatic Collapsed/SetCollapsedRecursive. Configure branch states separately.
| Name | Type | Default |
|---|---|---|
hide | bool | — |
hideHide normal folding controls while retaining branch states.
SetHideRootvoid
public void SetHideRoot(bool enable);Hides the root’s presentation while retaining the root and its children. Useful for a flat list with a shared hidden parent. Does not delete a row or change GetRoot.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enabletrue hides the root while retaining its structure.
SetScrollHintModevoid
public void SetScrollHintMode(Tree.ScrollHintModeEnum scrollHintMode);Configures visual hints for content hidden above/below: Disabled, Both, Top or Bottom. Does not enable scrolling or change its amount.
| Name | Type | Default |
|---|---|---|
scrollHintMode | Tree.ScrollHintModeEnum | — |
scrollHintModeDisabled, Both, Top or Bottom: visual hints for vertically hidden content.
SetSelectModevoid
public void SetSelectMode(Tree.SelectModeEnum mode);Single selects one cell, Row selects the selectable cells of one row, and Multi allows accumulated selection. Changing modes neither clears nor normalizes existing flags: call DeselectAll before switching. In Multi, the GetSelected cursor is not the full selection.
| Name | Type | Default |
|---|---|---|
mode | Tree.SelectModeEnum | — |
modeSingle, Row or Multi. Clear prior selection with DeselectAll before switching.
SetSelectedvoid
public void SetSelected(TreeItem item, int column);Selects the specified cell through the single-selection walk even in Multi, clearing previous flags on traversed rows. Can emit CellSelected, ItemSelected or MultiSelected. Hidden subtrees are skipped; call DeselectAll first to clear every row. item must belong to this Tree; null does not clear selection.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
column | int | — |
itemRow belonging to this Tree; in MultiSelected, the row of the changing cell. Do not free a signal-provided row during input processing.
columnColumn index from 0 through Tree.Columns - 1.
SetTileScrollHintvoid
public void SetTileScrollHint(bool tileScrollHint);Tile the scroll-hint texture rather than stretching it. This styles the hint rather than enabling cyclic list scrolling.
| Name | Type | Default |
|---|---|---|
tileScrollHint | bool | — |
tileScrollHintTile the hint texture rather than stretching it.
SetVScrollEnabledvoid
public void SetVScrollEnabled(bool hScroll);Enables vertical scrolling. With false, Tree’s minimum height includes content, so a container can expand the control. Configure horizontal scrolling separately.
| Name | Type | Default |
|---|---|---|
hScroll | bool | — |
hScrollEnable vertical scrolling; hScroll is a historical parameter name in this method.
Signals and events15
ButtonClickedEvent
public event Tree.ButtonClickedEventHandler ButtonClicked;Action-button activation: item, column, command ID and mouse button. id is the stored ID rather than an index. Resolve GetButtonById before modifying the button and check for -1. Keyboard activation can also report MouseButton.Left, so do not infer the input source solely from the last argument.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
column | long | — |
id | long | — |
mouseButtonIndex | long | — |
itemTree-owned row containing the activated button.
columnColumn index from 0 through Tree.Columns - 1.
idActivated command ID rather than a button index.
mouseButtonIndexMouse button; keyboard activation can also pass Left.
CellSelectedEvent
public event Action CellSelected;Cell cursor/selection changed through the selection path, including programmatic SetSelected. Not a universal notification for every flag change: Multi Select, Deselect and DeselectAll can run without it.
CheckPropagatedToItemEvent
public event Tree.CheckPropagatedToItemEventHandler CheckPropagatedToItem;Traversal notification from PropagateCheck(..., true): the source row, depth-first descendants, then ancestors bottom-up. Also emitted for unchanged values. Read IsChecked/IsIndeterminate for the supplied cell; collect a complete tree summary after traversal finishes. This is not ItemEdited or an automatic response to SetChecked.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
column | long | — |
itemVisited row owned by Tree; do not free it during traversal.
columnColumn index from 0 through Tree.Columns - 1.
ColumnTitleClickedEvent
public event Tree.ColumnTitleClickedEventHandler ColumnTitleClicked;The user activated the specified column header with a mouse button. Tree does not sort rows automatically: retain sort direction in the model and reorder explicitly. Programmatic changes to header text or styling do not emit this signal.
| Name | Type | Default |
|---|---|---|
column | long | — |
mouseButtonIndex | long | — |
columnColumn index from 0 through Columns - 1.
mouseButtonIndexMouse button that activated the header.
CustomItemClickedEvent
public event Tree.CustomItemClickedEventHandler CustomItemClicked;Notification from mouse editing of Custom after ItemEdited, carrying the mouse button. Context is GetEdited/GetEditedColumn. Programmatic EditSelected need not emit it; do not use it as a universal value-apply event.
| Name | Type | Default |
|---|---|---|
mouseButtonIndex | long | — |
mouseButtonIndexMouse button reported by this input path.
CustomPopupEditedEvent
public event Tree.CustomPopupEditedEventHandler CustomPopupEdited;Request for an application editor for a Custom cell. Context is already available through GetEdited/GetEditedColumn and the area through GetCustomPopupRect. EditSelected passes arrowClicked false and then emits ItemEdited. The application implements the window and value apply/cancel behavior.
| Name | Type | Default |
|---|---|---|
arrowClicked | bool | — |
arrowClickedWhether the Custom arrow was clicked; programmatic EditSelected passes false.
EmptyClickedEvent
public event Tree.EmptyClickedEventHandler EmptyClicked;Click on empty Tree content, reporting a local position and mouse button. Does not mean that the selection model is already cleared or that data should be deleted.
| Name | Type | Default |
|---|---|---|
clickPosition | Vector2 | — |
mouseButtonIndex | long | — |
clickPositionClick position in Tree-local coordinates.
mouseButtonIndexMouse button reported by this input path.
ItemActivatedEvent
public event Action ItemActivated;Row activation, such as a double click or ui_accept when the built-in editor/button did not handle the action. Read the current row through GetSelected. Separate from selection rather than a universal value-change notification.
ItemCollapsedEvent
public event Tree.ItemCollapsedEventHandler ItemCollapsed;The supplied row’s Collapsed state changed, including changes from code and expansion. Read item.IsCollapsed() for the new state. Reassigning the old value emits nothing. A recursive call produces separate row events rather than one final snapshot.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
itemTree-owned row with a new Collapsed state. Do not delete it during a recursive walk.
ItemEditedEvent
public event Action ItemEdited;Editing-path notification; read context with GetEdited/GetEditedColumn. Check has already toggled its value. For Custom, the signal can arrive when an editor is requested, before the application changes the value: it is not a universal commit. Programmatic SetText, SetChecked, SetRange and PropagateCheck do not themselves emit it.
ItemIconDoubleClickedEvent
public event Action ItemIconDoubleClicked;Notification from the icon/unhandled row-area double-click path. Distinct from action-button ButtonClicked and ItemActivated. Recheck the current row and whether the action is valid in the handler.
ItemMouseSelectedEvent
public event Tree.ItemMouseSelectedEventHandler ItemMouseSelected;The mouse-selection path reports a Tree-local position and mouse button. Not emitted for every programmatic Select/SetSelected. Handle selection signals and your own programmatic operations separately in the selection model.
| Name | Type | Default |
|---|---|---|
mousePosition | Vector2 | — |
mouseButtonIndex | long | — |
mousePositionMouse position in Tree-local coordinates.
mouseButtonIndexMouse button reported by this input path.
ItemSelectedEvent
public event Action ItemSelected;Selection notification in Single/Row, including changes from code. Read the current row through GetSelected. Does not enumerate Multi changes or report deselection.
MultiSelectedEvent
public event Tree.MultiSelectedEventHandler MultiSelected;In Multi, reports setting or clearing the specified cell’s flag. Programmatic SetSelected can emit it; TreeItem.Select/Deselect and DeselectAll do not. Replacement notifications occur during traversal, so update an aggregate model snapshot after the operation has completed.
| Name | Type | Default |
|---|---|---|
item | TreeItem | — |
column | long | — |
selected | bool | — |
itemRow belonging to this Tree; in MultiSelected, the row of the changing cell. Do not free a signal-provided row during input processing.
columnColumn index from 0 through Tree.Columns - 1.
selectedtrue sets the flag; false clears it. A change to one cell rather than a completed snapshot of the whole selection.
NothingSelectedEvent
public event Action NothingSelected;Notification from the left-click-on-empty-space path without Shift or the command modifier (Ctrl/Cmd). Not a universal selection-became-empty event: DeselectAll and programmatic deselection do not emit it. Check the actual selection separately.
Tree.DropModeFlagsEnum
| Value | Description |
|---|---|
Disabled = 0 | Disables all drop sections. Note: This is the default flag, it has no effect when combined with other flags. |
Inbetween = 2 | Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, while the "below item" drop section covers the bottom half, and extends downward to the left of any children.
When combined with |
OnItem = 1 | Enables the "on item" drop section. This drop section covers the entire item.
When combined with |
Tree.ScrollHintModeEnum
| Value | Description |
|---|---|
Both = 1 | Scroll hints will be shown at the top and bottom. |
Bottom = 3 | Only the bottom scroll hint will be shown. |
Disabled = 0 | Scroll hints will never be shown. |
Top = 2 | Only the top scroll hint will be shown. |
Tree.SelectModeEnum
| Value | Description |
|---|---|
Multi = 2 | Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item. The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected. |
Row = 1 | Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item. The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item. |
Single = 0 | Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item. The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item. |
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
children_hl_line_colorColor | The Color(0.27, 0.27, 0.27, 1) |
custom_button_font_highlightColor | Text Color(0.95, 0.95, 0.95, 1) |
drop_on_item_colorColor |
Color(1, 1, 1, 1) |
drop_position_colorColor |
Color(1, 1, 1, 1) |
font_colorColor | Default text Color(0.7, 0.7, 0.7, 1) |
font_disabled_colorColor | Text Color(0.875, 0.875, 0.875, 0.5) |
font_hovered_colorColor | Text Color(0.95, 0.95, 0.95, 1) |
font_hovered_dimmed_colorColor | Text Color(0.875, 0.875, 0.875, 1) |
font_hovered_selected_colorColor | Text Color(1, 1, 1, 1) |
font_outline_colorColor | The tint of text outline of the item. Default:Color(0, 0, 0, 1) |
font_selected_colorColor | Text Color(1, 1, 1, 1) |
guide_colorColor |
Color(0.7, 0.7, 0.7, 0.25) |
parent_hl_line_colorColor | The Color(0.27, 0.27, 0.27, 1) |
relationship_line_colorColor | The default Color(0.27, 0.27, 0.27, 1) |
scroll_hint_colorColor |
Color(0, 0, 0, 1) |
title_button_colorColor | Default text Color(0.875, 0.875, 0.875, 1) |
button_marginint | The horizontal space between each button in a cell. Default:4 |
check_h_separationint | The horizontal space between the checkbox and the text in a 4 |
children_hl_line_widthint | The width of the relationship lines between the selected 1 |
dragging_unfold_wait_msecint | During a drag-and-drop, this is how many milliseconds to wait over a section before the section unfolds. Default:500 |
draw_guidesint | Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item. Default:1 |
draw_relationship_linesint | Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. Default:0 |
h_separationint | The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. Default:4 |
icon_h_separationint | The horizontal space between the icon and the text in item's cells. Default:4 |
icon_max_widthint | The maximum allowed width of the icon in item's cells. This limit is applied on top of the default size of the icon, but before the value set with 0 |
inner_item_margin_bottomint | The inner bottom margin of a cell. Default:0 |
inner_item_margin_leftint | The inner left margin of a cell. Default:0 |
inner_item_margin_rightint | The inner right margin of a cell. Default:0 |
inner_item_margin_topint | The inner top margin of a cell. Default:0 |
item_marginint | The horizontal margin at the start of an item. This is used when folding is enabled for the item. Default:16 |
outline_sizeint | The size of the text outline.
Note: If using a font with 0 |
parent_hl_line_marginint | The space between the parent relationship lines for the selected 0 |
parent_hl_line_widthint | The width of the relationship lines between the selected 1 |
relationship_line_widthint | The default width of the relationship lines. Default:1 |
scroll_borderint | The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging. Default:4 |
scroll_max_sticky_itemsint | The maximum number of tree items allowed to stick to the top while its children are in view. A value of 0 |
scroll_speedint | The speed of border scrolling. Default:12 |
scrollbar_h_separationint | The horizontal separation of tree content and scrollbar. Default:4 |
scrollbar_margin_bottomint | The bottom margin of the scrollbars. When negative, uses -1 |
scrollbar_margin_leftint | The left margin of the horizontal scrollbar. When negative, uses -1 |
scrollbar_margin_rightint | The right margin of the scrollbars. When negative, uses -1 |
scrollbar_margin_topint | The top margin of the vertical scrollbar. When negative, uses -1 |
scrollbar_v_separationint | The vertical separation of tree content and scrollbar. Default:4 |
v_separationint | The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. Default:4 |
fontFont |
|
title_button_fontFont |
|
font_sizeint | Font size of the item's text. |
title_button_font_sizeint | Font size of the title button's text. |
arrowTexture2D | The arrow icon used when a foldable item is not collapsed. |
arrow_collapsedTexture2D | The arrow icon used when a foldable item is collapsed (for left-to-right layouts). |
arrow_collapsed_mirroredTexture2D | The arrow icon used when a foldable item is collapsed (for right-to-left layouts). |
checkedTexture2D | The check icon to display when the |
checked_disabledTexture2D | The check icon to display when the |
indeterminateTexture2D | The check icon to display when the |
indeterminate_disabledTexture2D | The check icon to display when the |
scroll_hintTexture2D | The indicator that will be shown when the content can still be scrolled. See |
select_arrowTexture2D | The arrow icon to display for the |
uncheckedTexture2D | The check icon to display when the |
unchecked_disabledTexture2D | The check icon to display when the |
updownTexture2D | The updown arrow icon to display for the |
focus_soundAudioStream | Played when this |
item_hovered_soundAudioStream | Played when an item is hovered. |
item_selected_soundAudioStream | Played when an item is selected. |
button_hoverStyleBox |
|
button_pressedStyleBox |
|
cursorStyleBox |
|
cursor_unfocusedStyleBox |
|
custom_buttonStyleBox | Default |
custom_button_hoverStyleBox |
|
custom_button_pressedStyleBox |
|
focusStyleBox | The focused style for the |
hoveredStyleBox |
|
hovered_dimmedStyleBox |
|
hovered_selectedStyleBox |
|
hovered_selected_focusStyleBox |
|
panelStyleBox | The background style for the |
selectedStyleBox |
|
selected_focusStyleBox |
|
title_button_hoverStyleBox |
|
title_button_normalStyleBox | Default |
title_button_pressedStyleBox |
|