Control for a single item inside a godot.Tree
. May have child godot.TreeItem
s and be styled as well as contain buttons.
You can remove a godot.TreeItem
by using godot.Object.free
.
Variables
Methods
addButton(column:Int, button:Texture, ?buttonIdx:Int, ?disabled:Bool, ?tooltip:String):Void
Adds a button with godot.Texture
button
at column column
. The button_idx
is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling godot.TreeItem.getButtonCount
immediately after this method. Optionally, the button can be disabled
and have a tooltip
.
callRecursive(method:String, args:HaxeArray<Dynamic>):Dynamic
Calls the method
on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
getButton(column:Int, buttonIdx:Int):Texture
Returns the godot.Texture
of the button at index button_idx
in column column
.
getButtonTooltip(column:Int, buttonIdx:Int):String
Returns the tooltip string for the button at index button_idx
in column column
.
getMetadata(column:Int):Dynamic
Returns the metadata value that was set for the given column using godot.TreeItem.setMetadata
.
getNextVisible(?wrap:Bool):TreeItem
Returns the next visible TreeItem in the tree or a null object if there is none.
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
.
getPrevVisible(?wrap:Bool):TreeItem
Returns the previous visible TreeItem in the tree or a null object if there is none.
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
.
getRangeConfig(column:Int):Dictionary
Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
isButtonDisabled(column:Int, buttonIdx:Int):Bool
Returns true
if the button at index button_idx
for the given column is disabled.
removeChild(child:Object):Void
Removes the given child godot.TreeItem
and all its children from the godot.Tree
. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a godot.TreeItem
use godot.Object.free
.
setButton(column:Int, buttonIdx:Int, button:Texture):Void
Sets the given column's button godot.Texture
at index button_idx
to button
.
setButtonDisabled(column:Int, buttonIdx:Int, disabled:Bool):Void
If true
, disables the button at index button_idx
in column column
.
setCellMode(column:Int, mode:TreeItem_TreeCellMode):Void
Sets the given column's cell mode to mode
. See godot.TreeItem_TreeCellMode
constants.
setCustomBgColor(column:Int, color:Color, ?justOutline:Bool):Void
Sets the given column's custom background color and whether to just use it as an outline.
setCustomDraw(column:Int, object:Object, callback:String):Void
Sets the given column's custom draw callback to callback
method on object
.
The callback
should accept two arguments: the godot.TreeItem
that is drawn and its position and size as a godot.Rect2
.
setMetadata(column:Int, meta:Dynamic):Void
Sets the metadata value for the given column, which can be retrieved later using godot.TreeItem.getMetadata
. This can be used, for example, to store a reference to the original data.
setRangeConfig(column:Int, min:Float, max:Float, step:Float, ?expr:Bool):Void
Sets the range of accepted values for a column. The column must be in the godot.TreeItem_TreeCellMode.range
mode.
If expr
is true
, the edit mode slider will use an exponential scale as with godot.Range.expEdit
.
setSuffix(column:Int, text:String):Void
Sets a string to be shown after a column's value (for example, a unit abbreviation).
setTextAlign(column:Int, textAlign:TreeItem_TextAlign):Void
Sets the given column's text alignment. See godot.TreeItem_TextAlign
for possible values.