Documentation
¶
Overview ¶
A single item of a [Tree] control. It can contain other [TreeItem]s as children, which allows it to create a hierarchy. It can also contain text and buttons. [TreeItem] is not a [Node], it is internal to the [Tree]. To create a [TreeItem], use [Instance.Tree.CreateItem] or [Instance.Treeitem.CreateChild]. To remove a [TreeItem], use [Instance.Object.Free]. Note: The ID values used for buttons are 32-bit, unlike [int] which is always 64-bit. They go from -2147483648 to 2147483647.
Index ¶
- type Advanced
- type Any
- type Expanded
- func (self Expanded) AddButton(column int, button Texture2D.Instance, id int, disabled bool, ...)
- func (self Expanded) CreateChild(index int) Instance
- func (self Expanded) GetNextInTree(wrap bool) Instance
- func (self Expanded) GetNextVisible(wrap bool) Instance
- func (self Expanded) GetPrevInTree(wrap bool) Instance
- func (self Expanded) GetPrevVisible(wrap bool) Instance
- func (self Expanded) IsAnyCollapsed(only_visible bool) bool
- func (self Expanded) PropagateCheck(column int, emit_signal bool)
- func (self Expanded) SetCustomBgColor(column int, color Color.RGBA, just_outline bool)
- func (self Expanded) SetRangeConfig(column int, min Float.X, max Float.X, step Float.X, expr bool)
- type Extension
- type ID
- type Instance
- func (self Instance) AddButton(column int, button Texture2D.Instance)
- func (self Instance) AddChild(child Instance)
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsTreeItem() Instance
- func (self Instance) CallRecursive(method string, args ...any)
- func (self Instance) ClearButtons()
- func (self Instance) ClearCustomBgColor(column int)
- func (self Instance) ClearCustomColor(column int)
- func (self Instance) Collapsed() bool
- func (self Instance) CreateChild() Instance
- func (self Instance) CustomMinimumHeight() int
- func (self Instance) Deselect(column int)
- func (self Instance) DisableFolding() bool
- func (self Instance) EraseButton(column int, button_index int)
- func (self Instance) GetAutoTranslateMode(column int) Node.AutoTranslateMode
- func (self Instance) GetAutowrapMode(column int) TextServer.AutowrapMode
- func (self Instance) GetButton(column int, button_index int) Texture2D.Instance
- func (self Instance) GetButtonById(column int, id int) int
- func (self Instance) GetButtonColor(column int, id int) Color.RGBA
- func (self Instance) GetButtonCount(column int) int
- func (self Instance) GetButtonId(column int, button_index int) int
- func (self Instance) GetButtonTooltipText(column int, button_index int) string
- func (self Instance) GetCellMode(column int) TreeCellMode
- func (self Instance) GetChild(index int) Instance
- func (self Instance) GetChildCount() int
- func (self Instance) GetChildren() []Instance
- func (self Instance) GetCustomBgColor(column int) Color.RGBA
- func (self Instance) GetCustomColor(column int) Color.RGBA
- func (self Instance) GetCustomDrawCallback(column int) Callable.Function
- func (self Instance) GetCustomFont(column int) Font.Instance
- func (self Instance) GetCustomFontSize(column int) int
- func (self Instance) GetExpandRight(column int) bool
- func (self Instance) GetFirstChild() Instance
- func (self Instance) GetIcon(column int) Texture2D.Instance
- func (self Instance) GetIconMaxWidth(column int) int
- func (self Instance) GetIconModulate(column int) Color.RGBA
- func (self Instance) GetIconOverlay(column int) Texture2D.Instance
- func (self Instance) GetIconRegion(column int) Rect2.PositionSize
- func (self Instance) GetIndex() int
- func (self Instance) GetLanguage(column int) string
- func (self Instance) GetMetadata(column int) any
- func (self Instance) GetNext() Instance
- func (self Instance) GetNextInTree() Instance
- func (self Instance) GetNextVisible() Instance
- func (self Instance) GetParent() Instance
- func (self Instance) GetPrev() Instance
- func (self Instance) GetPrevInTree() Instance
- func (self Instance) GetPrevVisible() Instance
- func (self Instance) GetRange(column int) Float.X
- func (self Instance) GetRangeConfig(column int) RangeConfig
- func (self Instance) GetStructuredTextBidiOverride(column int) TextServer.StructuredTextParser
- func (self Instance) GetStructuredTextBidiOverrideOptions(column int) []any
- func (self Instance) GetSuffix(column int) string
- func (self Instance) GetText(column int) string
- func (self Instance) GetTextAlignment(column int) GUI.HorizontalAlignment
- func (self Instance) GetTextDirection(column int) Control.TextDirection
- func (self Instance) GetTextOverrunBehavior(column int) TextServer.OverrunBehavior
- func (self Instance) GetTooltipText(column int) string
- func (self Instance) ID() ID
- func (self Instance) IsAnyCollapsed() bool
- func (self Instance) IsButtonDisabled(column int, button_index int) bool
- func (self Instance) IsChecked(column int) bool
- func (self Instance) IsCustomSetAsButton(column int) bool
- func (self Instance) IsEditMultiline(column int) bool
- func (self Instance) IsEditable(column int) bool
- func (self Instance) IsIndeterminate(column int) bool
- func (self Instance) IsSelectable(column int) bool
- func (self Instance) IsSelected(column int) bool
- func (self Instance) IsVisibleInTree() bool
- func (self Instance) MoveAfter(item Instance)
- func (self Instance) MoveBefore(item Instance)
- func (self Instance) PropagateCheck(column int)
- func (self Instance) RemoveChild(child Instance)
- func (self Instance) Select(column int)
- func (self Instance) SetAutoTranslateMode(column int, mode Node.AutoTranslateMode)
- func (self Instance) SetAutowrapMode(column int, autowrap_mode TextServer.AutowrapMode)
- func (self Instance) SetButton(column int, button_index int, button Texture2D.Instance)
- func (self Instance) SetButtonColor(column int, button_index int, color Color.RGBA)
- func (self Instance) SetButtonDisabled(column int, button_index int, disabled bool)
- func (self Instance) SetButtonTooltipText(column int, button_index int, tooltip string)
- func (self Instance) SetCellMode(column int, mode TreeCellMode)
- func (self Instance) SetChecked(column int, checked bool)
- func (self Instance) SetCollapsed(value bool)
- func (self Instance) SetCollapsedRecursive(enable bool)
- func (self Instance) SetCustomAsButton(column int, enable bool)
- func (self Instance) SetCustomBgColor(column int, color Color.RGBA)
- func (self Instance) SetCustomColor(column int, color Color.RGBA)
- func (self Instance) SetCustomDraw(column int, obj Object.Instance, callback string)
- func (self Instance) SetCustomDrawCallback(column int, callback func(item Instance, rect Rect2.PositionSize))
- func (self Instance) SetCustomFont(column int, font Font.Instance)
- func (self Instance) SetCustomFontSize(column int, font_size int)
- func (self Instance) SetCustomMinimumHeight(value int)
- func (self Instance) SetDisableFolding(value bool)
- func (self Instance) SetEditMultiline(column int, multiline bool)
- func (self Instance) SetEditable(column int, enabled bool)
- func (self Instance) SetExpandRight(column int, enable bool)
- func (self Instance) SetIcon(column int, texture Texture2D.Instance)
- func (self Instance) SetIconMaxWidth(column int, width int)
- func (self Instance) SetIconModulate(column int, modulate Color.RGBA)
- func (self Instance) SetIconOverlay(column int, texture Texture2D.Instance)
- func (self Instance) SetIconRegion(column int, region Rect2.PositionSize)
- func (self Instance) SetIndeterminate(column int, indeterminate bool)
- func (self Instance) SetLanguage(column int, language string)
- func (self Instance) SetMetadata(column int, meta any)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRange(column int, value Float.X)
- func (self Instance) SetRangeConfig(column int, min Float.X, max Float.X, step Float.X)
- func (self Instance) SetSelectable(column int, selectable bool)
- func (self Instance) SetStructuredTextBidiOverride(column int, parser TextServer.StructuredTextParser)
- func (self Instance) SetStructuredTextBidiOverrideOptions(column int, args []any)
- func (self Instance) SetSuffix(column int, text string)
- func (self Instance) SetText(column int, text string)
- func (self Instance) SetTextAlignment(column int, text_alignment GUI.HorizontalAlignment)
- func (self Instance) SetTextDirection(column int, direction Control.TextDirection)
- func (self Instance) SetTextOverrunBehavior(column int, overrun_behavior TextServer.OverrunBehavior)
- func (self Instance) SetTooltipText(column int, tooltip string)
- func (self Instance) SetVisible(value bool)
- func (self Instance) UncollapseTree()
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Visible() bool
- type RangeConfig
- type TreeCellMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Expanded ¶
func (Expanded) AddButton ¶
func (self Expanded) AddButton(column int, button Texture2D.Instance, id int, disabled bool, tooltip_text string)
Adds a button with [Texture2D] 'button' to the end of the cell at column 'column'. The 'id' is used to identify the button in the according [signal Tree.button_clicked] signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling Instance.GetButtonCount immediately before this method. Optionally, the button can be 'disabled' and have a 'tooltip_text'.
func (Expanded) CreateChild ¶
Creates an item and adds it as a child. The new item will be inserted as position 'index' (the default value -1 means the last position), or it will be the last child if 'index' is higher than the child count.
func (Expanded) GetNextInTree ¶
Returns the next TreeItem in the tree (in the context of a depth-first search) or a null object if there is none. If 'wrap' is enabled, the method will wrap around to the first element in the tree when called on the last element, otherwise it returns null.
func (Expanded) GetNextVisible ¶
Returns the next visible TreeItem in the tree (in the context of a depth-first search) 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.
func (Expanded) GetPrevInTree ¶
Returns the previous TreeItem in the tree (in the context of a depth-first search) or a null object if there is none. If 'wrap' is enabled, the method will wrap around to the last element in the tree when called on the first visible element, otherwise it returns null.
func (Expanded) GetPrevVisible ¶
Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first search) 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.
func (Expanded) IsAnyCollapsed ¶
Returns true if this [TreeItem], or any of its descendants, is collapsed. If 'only_visible' is true it ignores non-visible [TreeItem]s.
func (Expanded) PropagateCheck ¶
Propagates this item's checked status to its children and parents for the given 'column'. It is possible to process the items affected by this method call by connecting to [signal Tree.check_propagated_to_item]. The order that the items affected will be processed is as follows: the item invoking this method, children of that item, and finally parents of that item. If 'emit_signal' is false, then [signal Tree.check_propagated_to_item] will not be emitted.
func (Expanded) SetCustomBgColor ¶
Sets the given column's custom background color and whether to just use it as an outline.
func (Expanded) SetRangeConfig ¶
Sets the range of accepted values for a column. The column must be in the CellModeRange mode. If 'expr' is true, the edit mode slider will use an exponential scale as with [member Range.exp_edit].
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsTreeItem ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddButton ¶
Adds a button with [Texture2D] 'button' to the end of the cell at column 'column'. The 'id' is used to identify the button in the according [signal Tree.button_clicked] signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling Instance.GetButtonCount immediately before this method. Optionally, the button can be 'disabled' and have a 'tooltip_text'.
func (Instance) AddChild ¶
Adds a previously unparented [TreeItem] as a direct child of this one. The 'child' item must not be a part of any [Tree] or parented to any [TreeItem]. See also Instance.RemoveChild.
func (Instance) AsTreeItem ¶
func (Instance) CallRecursive ¶
Calls the 'method' on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
func (Instance) ClearButtons ¶
func (self Instance) ClearButtons()
Removes all buttons from all columns of this item.
func (Instance) ClearCustomBgColor ¶
Resets the background color for the given column to default.
func (Instance) ClearCustomColor ¶
Resets the color for the given column to default.
func (Instance) CreateChild ¶
Creates an item and adds it as a child. The new item will be inserted as position 'index' (the default value -1 means the last position), or it will be the last child if 'index' is higher than the child count.
func (Instance) CustomMinimumHeight ¶
func (Instance) DisableFolding ¶
func (Instance) EraseButton ¶
Removes the button at index 'button_index' in column 'column'.
func (Instance) GetAutoTranslateMode ¶
func (self Instance) GetAutoTranslateMode(column int) Node.AutoTranslateMode
Returns the column's auto translate mode.
func (Instance) GetAutowrapMode ¶
func (self Instance) GetAutowrapMode(column int) TextServer.AutowrapMode
Returns the text autowrap mode in the given 'column'. By default it is [Textserver.AutowrapOff].
func (Instance) GetButton ¶
Returns the [Texture2D] of the button at index 'button_index' in column 'column'.
func (Instance) GetButtonById ¶
Returns the button index if there is a button with ID 'id' in column 'column', otherwise returns -1.
func (Instance) GetButtonColor ¶
Returns the color of the button with ID 'id' in column 'column'. If the specified button does not exist, returns [Color.Black].
func (Instance) GetButtonCount ¶
Returns the number of buttons in column 'column'.
func (Instance) GetButtonId ¶
Returns the ID for the button at index 'button_index' in column 'column'.
func (Instance) GetButtonTooltipText ¶
Returns the tooltip text for the button at index 'button_index' in column 'column'.
func (Instance) GetCellMode ¶
func (self Instance) GetCellMode(column int) TreeCellMode
Returns the column's cell mode.
func (Instance) GetChild ¶
Returns a child item by its 'index' (see Instance.GetChildCount). This method is often used for iterating all children of an item. Negative indices access the children from the last one.
func (Instance) GetChildCount ¶
Returns the number of child items.
func (Instance) GetChildren ¶
Returns an array of references to the item's children.
func (Instance) GetCustomBgColor ¶
Returns the custom background color of column 'column'.
func (Instance) GetCustomColor ¶
Returns the custom color of column 'column'.
func (Instance) GetCustomDrawCallback ¶
Returns the custom callback of column 'column'.
func (Instance) GetCustomFont ¶
Returns custom font used to draw text in the column 'column'.
func (Instance) GetCustomFontSize ¶
Returns custom font size used to draw text in the column 'column'.
func (Instance) GetExpandRight ¶
Returns true if expand_right is set.
func (Instance) GetFirstChild ¶
Returns the TreeItem's first child.
func (Instance) GetIconMaxWidth ¶
Returns the maximum allowed width of the icon in the given 'column'.
func (Instance) GetIconModulate ¶
Returns the [Color] modulating the column's icon.
func (Instance) GetIconOverlay ¶
Returns the given column's icon overlay [Texture2D].
func (Instance) GetIconRegion ¶
func (self Instance) GetIconRegion(column int) Rect2.PositionSize
Returns the icon [Texture2D] region as [Rect2].
func (Instance) GetIndex ¶
Returns the node's order in the tree. For example, if called on the first child item the position is 0.
func (Instance) GetLanguage ¶
Returns item's text language code.
func (Instance) GetMetadata ¶
Returns the metadata value that was set for the given column using Instance.SetMetadata.
func (Instance) GetNext ¶
Returns the next sibling TreeItem in the tree or a null object if there is none.
func (Instance) GetNextInTree ¶
Returns the next TreeItem in the tree (in the context of a depth-first search) or a null object if there is none. If 'wrap' is enabled, the method will wrap around to the first element in the tree when called on the last element, otherwise it returns null.
func (Instance) GetNextVisible ¶
Returns the next visible TreeItem in the tree (in the context of a depth-first search) 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.
func (Instance) GetPrev ¶
Returns the previous sibling TreeItem in the tree or a null object if there is none.
func (Instance) GetPrevInTree ¶
Returns the previous TreeItem in the tree (in the context of a depth-first search) or a null object if there is none. If 'wrap' is enabled, the method will wrap around to the last element in the tree when called on the first visible element, otherwise it returns null.
func (Instance) GetPrevVisible ¶
Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first search) 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.
func (Instance) GetRange ¶
Returns the value of a CellModeRange column.
func (Instance) GetRangeConfig ¶
func (self Instance) GetRangeConfig(column int) RangeConfig
Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
func (Instance) GetStructuredTextBidiOverride ¶
func (self Instance) GetStructuredTextBidiOverride(column int) TextServer.StructuredTextParser
Returns the BiDi algorithm override set for this cell.
func (Instance) GetStructuredTextBidiOverrideOptions ¶
Returns the additional BiDi options set for this cell.
func (Instance) GetTextAlignment ¶
func (self Instance) GetTextAlignment(column int) GUI.HorizontalAlignment
Returns the given column's text alignment.
func (Instance) GetTextDirection ¶
func (self Instance) GetTextDirection(column int) Control.TextDirection
Returns item's text base writing direction.
func (Instance) GetTextOverrunBehavior ¶
func (self Instance) GetTextOverrunBehavior(column int) TextServer.OverrunBehavior
Returns the clipping behavior when the text exceeds the item's bounding rectangle in the given 'column'. By default it is [Textserver.OverrunTrimEllipsis].
func (Instance) GetTooltipText ¶
Returns the given column's tooltip text.
func (Instance) IsAnyCollapsed ¶
Returns true if this [TreeItem], or any of its descendants, is collapsed. If 'only_visible' is true it ignores non-visible [TreeItem]s.
func (Instance) IsButtonDisabled ¶
Returns true if the button at index 'button_index' for the given 'column' is disabled.
func (Instance) IsCustomSetAsButton ¶
Returns true if the cell was made into a button with Instance.SetCustomAsButton.
func (Instance) IsEditMultiline ¶
Returns true if the given 'column' is multiline editable.
func (Instance) IsEditable ¶
Returns true if the given 'column' is editable.
func (Instance) IsIndeterminate ¶
Returns true if the given 'column' is indeterminate.
func (Instance) IsSelectable ¶
Returns true if the given 'column' is selectable.
func (Instance) IsSelected ¶
Returns true if the given 'column' is selected.
func (Instance) IsVisibleInTree ¶
Returns true if [member visible] is true and all its ancestors are also visible.
func (Instance) MoveAfter ¶
Moves this TreeItem right after the given 'item'. Note: You can't move to the root or move the root.
func (Instance) MoveBefore ¶
Moves this TreeItem right before the given 'item'. Note: You can't move to the root or move the root.
func (Instance) PropagateCheck ¶
Propagates this item's checked status to its children and parents for the given 'column'. It is possible to process the items affected by this method call by connecting to [signal Tree.check_propagated_to_item]. The order that the items affected will be processed is as follows: the item invoking this method, children of that item, and finally parents of that item. If 'emit_signal' is false, then [signal Tree.check_propagated_to_item] will not be emitted.
func (Instance) RemoveChild ¶
Removes the given child [TreeItem] and all its children from the [Tree]. Note that it doesn't free the item from memory, so it can be reused later (see Instance.AddChild). To completely remove a [TreeItem] use [Instance.Object.Free]. Note: If you want to move a child from one [Tree] to another, then instead of removing and adding it manually you can use Instance.MoveBefore or Instance.MoveAfter.
func (Instance) SetAutoTranslateMode ¶
func (self Instance) SetAutoTranslateMode(column int, mode Node.AutoTranslateMode)
Sets the given column's auto translate mode to 'mode'. All columns use [Node.AutoTranslateModeInherit] by default, which uses the same auto translate mode as the [Tree] itself.
func (Instance) SetAutowrapMode ¶
func (self Instance) SetAutowrapMode(column int, autowrap_mode TextServer.AutowrapMode)
Sets the autowrap mode in the given 'column'. If set to something other than [Textserver.AutowrapOff], the text gets wrapped inside the cell's bounding rectangle.
func (Instance) SetButton ¶
Sets the given column's button [Texture2D] at index 'button_index' to 'button'.
func (Instance) SetButtonColor ¶
Sets the given column's button color at index 'button_index' to 'color'.
func (Instance) SetButtonDisabled ¶
If true, disables the button at index 'button_index' in the given 'column'.
func (Instance) SetButtonTooltipText ¶
Sets the tooltip text for the button at index 'button_index' in the given 'column'.
func (Instance) SetCellMode ¶
func (self Instance) SetCellMode(column int, mode TreeCellMode)
Sets the given column's cell mode to 'mode'. This determines how the cell is displayed and edited. See TreeCellMode constants for details.
func (Instance) SetChecked ¶
If 'checked' is true, the given 'column' is checked. Clears column's indeterminate status.
func (Instance) SetCollapsed ¶
func (Instance) SetCollapsedRecursive ¶
Collapses or uncollapses this [TreeItem] and all the descendants of this item.
func (Instance) SetCustomAsButton ¶
Makes a cell with CellModeCustom display as a non-flat button with a [StyleBox].
func (Instance) SetCustomBgColor ¶
Sets the given column's custom background color and whether to just use it as an outline.
func (Instance) SetCustomColor ¶
Sets the given column's custom color.
func (Instance) SetCustomDraw ¶
Sets the given column's custom draw callback to the 'callback' method on 'object'. The method named 'callback' should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
func (Instance) SetCustomDrawCallback ¶
func (self Instance) SetCustomDrawCallback(column int, callback func(item Instance, rect Rect2.PositionSize))
Sets the given column's custom draw callback. Use an empty [Callable] (Callable()) to clear the custom callback. The cell has to be in CellModeCustom to use this feature. The 'callback' should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
func (Instance) SetCustomFont ¶
Sets custom font used to draw text in the given 'column'.
func (Instance) SetCustomFontSize ¶
Sets custom font size used to draw text in the given 'column'.
func (Instance) SetCustomMinimumHeight ¶
func (Instance) SetDisableFolding ¶
func (Instance) SetEditMultiline ¶
If 'multiline' is true, the given 'column' is multiline editable. Note: This option only affects the type of control ([LineEdit] or [TextEdit]) that appears when editing the column. You can set multiline values with Instance.SetText even if the column is not multiline editable.
func (Instance) SetEditable ¶
If 'enabled' is true, the given 'column' is editable.
func (Instance) SetExpandRight ¶
If 'enable' is true, the given 'column' is expanded to the right.
func (Instance) SetIcon ¶
Sets the given cell's icon [Texture2D]. If the cell is in CellModeIcon mode, the icon is displayed in the center of the cell. Otherwise, the icon is displayed before the cell's text. CellModeRange does not display an icon.
func (Instance) SetIconMaxWidth ¶
Sets the maximum allowed width of the icon in the given 'column'. This limit is applied on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height is adjusted according to the icon's ratio.
func (Instance) SetIconModulate ¶
Modulates the given column's icon with 'modulate'.
func (Instance) SetIconOverlay ¶
Sets the given cell's icon overlay [Texture2D]. The cell has to be in CellModeIcon mode, and icon has to be set. Overlay is drawn on top of icon, in the bottom left corner.
func (Instance) SetIconRegion ¶
func (self Instance) SetIconRegion(column int, region Rect2.PositionSize)
Sets the given column's icon's texture region.
func (Instance) SetIndeterminate ¶
If 'indeterminate' is true, the given 'column' is marked indeterminate. Note: If set true from false, then column is cleared of checked status.
func (Instance) SetLanguage ¶
Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
func (Instance) SetMetadata ¶
Sets the metadata value for the given column, which can be retrieved later using Instance.GetMetadata. This can be used, for example, to store a reference to the original data.
func (Instance) SetRange ¶
Sets the value of a CellModeRange column.
func (Instance) SetRangeConfig ¶
Sets the range of accepted values for a column. The column must be in the CellModeRange mode. If 'expr' is true, the edit mode slider will use an exponential scale as with [member Range.exp_edit].
func (Instance) SetSelectable ¶
If 'selectable' is true, the given 'column' is selectable.
func (Instance) SetStructuredTextBidiOverride ¶
func (self Instance) SetStructuredTextBidiOverride(column int, parser TextServer.StructuredTextParser)
Set BiDi algorithm override for the structured text. Has effect for cells that display text.
func (Instance) SetStructuredTextBidiOverrideOptions ¶
Set additional options for BiDi override. Has effect for cells that display text.
func (Instance) SetSuffix ¶
Sets a string to be shown after a column's value (for example, a unit abbreviation).
func (Instance) SetTextAlignment ¶
func (self Instance) SetTextAlignment(column int, text_alignment GUI.HorizontalAlignment)
Sets the given column's text alignment. See [HorizontalAlignment] for possible values.
func (Instance) SetTextDirection ¶
func (self Instance) SetTextDirection(column int, direction Control.TextDirection)
Sets item's text base writing direction.
func (Instance) SetTextOverrunBehavior ¶
func (self Instance) SetTextOverrunBehavior(column int, overrun_behavior TextServer.OverrunBehavior)
Sets the clipping behavior when the text exceeds the item's bounding rectangle in the given 'column'.
func (Instance) SetTooltipText ¶
Sets the given column's tooltip text.
func (Instance) SetVisible ¶
func (Instance) UncollapseTree ¶
func (self Instance) UncollapseTree()
Uncollapses all [TreeItem]s necessary to reveal this [TreeItem], i.e. all ancestor [TreeItem]s.
type RangeConfig ¶
type TreeCellMode ¶
type TreeCellMode int //gd:TreeItem.TreeCellMode
const ( /*Cell shows a string label, optionally with an icon. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used.*/ CellModeString TreeCellMode = 0 /*Cell shows a checkbox, optionally with text and an icon. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable.*/ CellModeCheck TreeCellMode = 1 /*Cell shows a numeric range. When editable, it can be edited using a range slider. Use [method set_range] to set the value and [method set_range_config] to configure the range. This cell can also be used in a text dropdown mode when you assign a text with [method set_text]. Separate options with a comma, e.g. [code]"Option1,Option2,Option3"[/code].*/ CellModeRange TreeCellMode = 2 /*Cell shows an icon. It can't be edited nor display text. The icon is always centered within the cell.*/ CellModeIcon TreeCellMode = 3 /*Cell shows as a clickable button. It will display an arrow similar to [OptionButton], but doesn't feature a dropdown (for that you can use [constant CELL_MODE_RANGE]). Clicking the button emits the [signal Tree.item_edited] signal. The button is flat by default, you can use [method set_custom_as_button] to display it with a [StyleBox]. This mode also supports custom drawing using [method set_custom_draw_callback].*/ CellModeCustom TreeCellMode = 4 )