Struct TreeItem

Control for a single item inside a Tree.

struct TreeItem ;

May have child TreeItems and be styled as well as contain buttons.

Properties

NameTypeDescription
collapsed[get, set] boolIf true, the TreeItem is collapsed.
customMinimumHeight[get, set] longThe custom minimum height.
disableFolding[get, set] boolIf true, folding is disabled for this TreeItem.

Methods

NameDescription
addButton Adds a button with Texture button at column column. The button_idx index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling getButtonCount immediately after this method. Optionally, the button can be disabled and have a tooltip.
callRecursive Calls the method on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
clearCustomBgColor Resets the background color for the given column to default.
clearCustomColor Resets the color for the given column to default.
deselect Deselects the given column.
eraseButton Removes the button at index button_idx in column column.
getButton Returns the Texture of the button at index button_idx in column column.
getButtonCount Returns the number of buttons in column column. May be used to get the most recently added button's index, if no index was specified.
getButtonTooltip Returns the tooltip string for the button at index button_idx in column column.
getCellMode Returns the column's cell mode.
getChildren Returns the TreeItem's child items.
getCustomBgColor Returns the custom background color of column column.
getCustomColor Returns the custom color of column column.
getCustomMinimumHeight
getExpandRight Returns true if expand_right is set.
getIcon Returns the given column's icon Texture. Error if no icon is set.
getIconMaxWidth Returns the column's icon's maximum width.
getIconModulate Returns the Color modulating the column's icon.
getIconRegion Returns the icon Texture region as Rect2.
getMetadata
getNext Returns the next TreeItem in the tree.
getNextVisible Returns the next visible TreeItem in the tree. If wrap is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns null.
getParent Returns the parent TreeItem.
getPrev Returns the previous TreeItem in the tree.
getPrevVisible Returns the previous visible TreeItem in the tree. If wrap is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns null.
getRange
getRangeConfig
getText Returns the given column's text.
getTextAlign Returns the given column's text alignment.
getTooltip Returns the given column's tooltip.
isButtonDisabled Returns true if the button at index button_idx for the given column is disabled.
isChecked Returns true if the given column is checked.
isCollapsed
isCustomSetAsButton
isEditable Returns true if column column is editable.
isFoldingDisabled
isSelectable Returns true if column column is selectable.
isSelected Returns true if column column is selected.
moveToBottom Moves this TreeItem to the bottom in the Tree hierarchy.
moveToTop Moves this TreeItem to the top in the Tree hierarchy.
removeChild Removes the given child TreeItem.
select Selects the column column.
setButton Sets the given column's button Texture at index button_idx to button.
setButtonDisabled If true, disables the button at index button_idx in column column.
setCellMode Sets the given column's cell mode to mode. See treecellmode constants.
setChecked If true, the column column is checked.
setCollapsed
setCustomAsButton
setCustomBgColor Sets the given column's custom background color and whether to just use it as an outline.
setCustomColor Sets the given column's custom color.
setCustomDraw Sets the given column's custom draw callback to callback method on object. The callback should accept two arguments: the TreeItem that is drawn and its position and size as a Rect2.
setCustomMinimumHeight
setDisableFolding
setEditable If true, column column is editable.
setExpandRight If true, column column is expanded to the right.
setIcon Sets the given column's icon Texture.
setIconMaxWidth Sets the given column's icon's maximum width.
setIconModulate Modulates the given column's icon with modulate.
setIconRegion Sets the given column's icon's texture region.
setMetadata
setRange
setRangeConfig
setSelectable If true, the given column is selectable.
setText
setTextAlign Sets the given column's text alignment. See textalign for possible values.
setTooltip Sets the given column's tooltip text.

Enums

NameDescription
Constants
TextAlign
TreeCellMode