:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TreeItem.xml. .. _class_TreeItem: TreeItem ======== **Inherits:** :ref:`Object` Control for a single item inside a :ref:`Tree`. .. rst-class:: classref-introduction-group Description ----------- Control for a single item inside a :ref:`Tree`. May have child **TreeItem**\ s and be styled as well as contain buttons. You can remove a **TreeItem** by using :ref:`Object.free`. \ **Note:** The ID values used for buttons are limited to 32 bits, not full 64 bits of :ref:`int`. This has a range of ``-2^32`` to ``2^32 - 1``, i.e. ``-2147483648`` to ``2147483647``. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------+-----------------------------------------------------------------------------+ | :ref:`bool` | :ref:`collapsed` | +-------------------------+-----------------------------------------------------------------------------+ | :ref:`int` | :ref:`custom_minimum_height` | +-------------------------+-----------------------------------------------------------------------------+ | :ref:`bool` | :ref:`disable_folding` | +-------------------------+-----------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_button` **(** :ref:`int` column, :ref:`Texture` button, :ref:`int` id=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`call_recursive` **(** :ref:`String` method, ... **)** |vararg| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_custom_bg_color` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_custom_color` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`deselect` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`erase_button` **(** :ref:`int` column, :ref:`int` button_idx **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_button` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_by_id` **(** :ref:`int` column, :ref:`int` id **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_count` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_button_id` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_button_tooltip` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeCellMode` | :ref:`get_cell_mode` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_children` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_custom_bg_color` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_custom_color` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_expand_right` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_icon` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_icon_max_width` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_icon_modulate` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`get_icon_region` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_metadata` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_next` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_next_visible` **(** :ref:`bool` wrap=false **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_parent` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_prev` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_prev_visible` **(** :ref:`bool` wrap=false **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_range` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`get_range_config` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_suffix` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_text` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TextAlign` | :ref:`get_text_align` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_tooltip` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_button_disabled` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_checked` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_custom_set_as_button` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_editable` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selectable` **(** :ref:`int` column **)** |const| | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selected` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_to_bottom` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_to_top` **(** **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_child` **(** :ref:`Object` child **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` column **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_button` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture` button **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_button_disabled` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_cell_mode` **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_checked` **(** :ref:`int` column, :ref:`bool` checked **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_as_button` **(** :ref:`int` column, :ref:`bool` enable **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_bg_color` **(** :ref:`int` column, :ref:`Color` color, :ref:`bool` just_outline=false **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_color` **(** :ref:`int` column, :ref:`Color` color **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_draw` **(** :ref:`int` column, :ref:`Object` object, :ref:`String` callback **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_editable` **(** :ref:`int` column, :ref:`bool` enabled **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_expand_right` **(** :ref:`int` column, :ref:`bool` enable **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon` **(** :ref:`int` column, :ref:`Texture` texture **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon_max_width` **(** :ref:`int` column, :ref:`int` width **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon_modulate` **(** :ref:`int` column, :ref:`Color` modulate **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_icon_region` **(** :ref:`int` column, :ref:`Rect2` region **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_metadata` **(** :ref:`int` column, :ref:`Variant` meta **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_range` **(** :ref:`int` column, :ref:`float` value **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_range_config` **(** :ref:`int` column, :ref:`float` min, :ref:`float` max, :ref:`float` step, :ref:`bool` expr=false **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_selectable` **(** :ref:`int` column, :ref:`bool` selectable **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_suffix` **(** :ref:`int` column, :ref:`String` text **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text` **(** :ref:`int` column, :ref:`String` text **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text_align` **(** :ref:`int` column, :ref:`TextAlign` text_align **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tooltip` **(** :ref:`int` column, :ref:`String` tooltip **)** | +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_TreeItem_TreeCellMode: .. rst-class:: classref-enumeration enum **TreeCellMode**: .. _class_TreeItem_constant_CELL_MODE_STRING: .. rst-class:: classref-enumeration-constant :ref:`TreeCellMode` **CELL_MODE_STRING** = ``0`` Cell contains a string. .. _class_TreeItem_constant_CELL_MODE_CHECK: .. rst-class:: classref-enumeration-constant :ref:`TreeCellMode` **CELL_MODE_CHECK** = ``1`` Cell contains a checkbox. .. _class_TreeItem_constant_CELL_MODE_RANGE: .. rst-class:: classref-enumeration-constant :ref:`TreeCellMode` **CELL_MODE_RANGE** = ``2`` Cell contains a range. .. _class_TreeItem_constant_CELL_MODE_ICON: .. rst-class:: classref-enumeration-constant :ref:`TreeCellMode` **CELL_MODE_ICON** = ``3`` Cell contains an icon. .. _class_TreeItem_constant_CELL_MODE_CUSTOM: .. rst-class:: classref-enumeration-constant :ref:`TreeCellMode` **CELL_MODE_CUSTOM** = ``4`` .. rst-class:: classref-item-separator ---- .. _enum_TreeItem_TextAlign: .. rst-class:: classref-enumeration enum **TextAlign**: .. _class_TreeItem_constant_ALIGN_LEFT: .. rst-class:: classref-enumeration-constant :ref:`TextAlign` **ALIGN_LEFT** = ``0`` Align text to the left. See ``set_text_align()``. .. _class_TreeItem_constant_ALIGN_CENTER: .. rst-class:: classref-enumeration-constant :ref:`TextAlign` **ALIGN_CENTER** = ``1`` Center text. See ``set_text_align()``. .. _class_TreeItem_constant_ALIGN_RIGHT: .. rst-class:: classref-enumeration-constant :ref:`TextAlign` **ALIGN_RIGHT** = ``2`` Align text to the right. See ``set_text_align()``. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_TreeItem_property_collapsed: .. rst-class:: classref-property :ref:`bool` **collapsed** .. rst-class:: classref-property-setget - void **set_collapsed** **(** :ref:`bool` value **)** - :ref:`bool` **is_collapsed** **(** **)** If ``true``, the TreeItem is collapsed. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_property_custom_minimum_height: .. rst-class:: classref-property :ref:`int` **custom_minimum_height** .. rst-class:: classref-property-setget - void **set_custom_minimum_height** **(** :ref:`int` value **)** - :ref:`int` **get_custom_minimum_height** **(** **)** The custom minimum height. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_property_disable_folding: .. rst-class:: classref-property :ref:`bool` **disable_folding** .. rst-class:: classref-property-setget - void **set_disable_folding** **(** :ref:`bool` value **)** - :ref:`bool` **is_folding_disabled** **(** **)** If ``true``, folding is disabled for this TreeItem. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_TreeItem_method_add_button: .. rst-class:: classref-method void **add_button** **(** :ref:`int` column, :ref:`Texture` button, :ref:`int` id=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** Adds a button with :ref:`Texture` ``button`` at column ``column``. The ``id`` is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count` immediately before this method. Optionally, the button can be ``disabled`` and have a ``tooltip``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_call_recursive: .. rst-class:: classref-method :ref:`Variant` **call_recursive** **(** :ref:`String` method, ... **)** |vararg| Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_clear_custom_bg_color: .. rst-class:: classref-method void **clear_custom_bg_color** **(** :ref:`int` column **)** Resets the background color for the given column to default. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_clear_custom_color: .. rst-class:: classref-method void **clear_custom_color** **(** :ref:`int` column **)** Resets the color for the given column to default. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_deselect: .. rst-class:: classref-method void **deselect** **(** :ref:`int` column **)** Deselects the given column. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_erase_button: .. rst-class:: classref-method void **erase_button** **(** :ref:`int` column, :ref:`int` button_idx **)** Removes the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_button: .. rst-class:: classref-method :ref:`Texture` **get_button** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| Returns the :ref:`Texture` of the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_button_by_id: .. rst-class:: classref-method :ref:`int` **get_button_by_id** **(** :ref:`int` column, :ref:`int` id **)** |const| Returns the button index if there is a button with id ``id`` in column ``column``, otherwise returns -1. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_button_count: .. rst-class:: classref-method :ref:`int` **get_button_count** **(** :ref:`int` column **)** |const| Returns the number of buttons in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_button_id: .. rst-class:: classref-method :ref:`int` **get_button_id** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| Returns the id for the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_button_tooltip: .. rst-class:: classref-method :ref:`String` **get_button_tooltip** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| Returns the tooltip string for the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_cell_mode: .. rst-class:: classref-method :ref:`TreeCellMode` **get_cell_mode** **(** :ref:`int` column **)** |const| Returns the column's cell mode. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_children: .. rst-class:: classref-method :ref:`TreeItem` **get_children** **(** **)** Returns the TreeItem's first child item or a null object if there is none. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_custom_bg_color: .. rst-class:: classref-method :ref:`Color` **get_custom_bg_color** **(** :ref:`int` column **)** |const| Returns the custom background color of column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_custom_color: .. rst-class:: classref-method :ref:`Color` **get_custom_color** **(** :ref:`int` column **)** |const| Returns the custom color of column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_expand_right: .. rst-class:: classref-method :ref:`bool` **get_expand_right** **(** :ref:`int` column **)** |const| Returns ``true`` if ``expand_right`` is set. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_icon: .. rst-class:: classref-method :ref:`Texture` **get_icon** **(** :ref:`int` column **)** |const| Returns the given column's icon :ref:`Texture`. Error if no icon is set. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_icon_max_width: .. rst-class:: classref-method :ref:`int` **get_icon_max_width** **(** :ref:`int` column **)** |const| Returns the column's icon's maximum width. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_icon_modulate: .. rst-class:: classref-method :ref:`Color` **get_icon_modulate** **(** :ref:`int` column **)** |const| Returns the :ref:`Color` modulating the column's icon. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_icon_region: .. rst-class:: classref-method :ref:`Rect2` **get_icon_region** **(** :ref:`int` column **)** |const| Returns the icon :ref:`Texture` region as :ref:`Rect2`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_metadata: .. rst-class:: classref-method :ref:`Variant` **get_metadata** **(** :ref:`int` column **)** |const| Returns the metadata value that was set for the given column using :ref:`set_metadata`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_next: .. rst-class:: classref-method :ref:`TreeItem` **get_next** **(** **)** Returns the next sibling TreeItem in the tree or a null object if there is none. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_next_visible: .. rst-class:: classref-method :ref:`TreeItem` **get_next_visible** **(** :ref:`bool` wrap=false **)** Returns the next visible sibling 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``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_parent: .. rst-class:: classref-method :ref:`TreeItem` **get_parent** **(** **)** Returns the parent TreeItem or a null object if there is none. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_prev: .. rst-class:: classref-method :ref:`TreeItem` **get_prev** **(** **)** Returns the previous sibling TreeItem in the tree or a null object if there is none. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_prev_visible: .. rst-class:: classref-method :ref:`TreeItem` **get_prev_visible** **(** :ref:`bool` wrap=false **)** Returns the previous visible sibling 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``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_range: .. rst-class:: classref-method :ref:`float` **get_range** **(** :ref:`int` column **)** |const| Returns the value of a :ref:`CELL_MODE_RANGE` column. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_range_config: .. rst-class:: classref-method :ref:`Dictionary` **get_range_config** **(** :ref:`int` column **)** Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr". .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_suffix: .. rst-class:: classref-method :ref:`String` **get_suffix** **(** :ref:`int` column **)** |const| Gets the suffix string shown after the column value. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_text: .. rst-class:: classref-method :ref:`String` **get_text** **(** :ref:`int` column **)** |const| Returns the given column's text. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_text_align: .. rst-class:: classref-method :ref:`TextAlign` **get_text_align** **(** :ref:`int` column **)** |const| Returns the given column's text alignment. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_get_tooltip: .. rst-class:: classref-method :ref:`String` **get_tooltip** **(** :ref:`int` column **)** |const| Returns the given column's tooltip. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_button_disabled: .. rst-class:: classref-method :ref:`bool` **is_button_disabled** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| Returns ``true`` if the button at index ``button_idx`` for the given column is disabled. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_checked: .. rst-class:: classref-method :ref:`bool` **is_checked** **(** :ref:`int` column **)** |const| Returns ``true`` if the given column is checked. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_custom_set_as_button: .. rst-class:: classref-method :ref:`bool` **is_custom_set_as_button** **(** :ref:`int` column **)** |const| .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_editable: .. rst-class:: classref-method :ref:`bool` **is_editable** **(** :ref:`int` column **)** Returns ``true`` if column ``column`` is editable. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_selectable: .. rst-class:: classref-method :ref:`bool` **is_selectable** **(** :ref:`int` column **)** |const| Returns ``true`` if column ``column`` is selectable. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_is_selected: .. rst-class:: classref-method :ref:`bool` **is_selected** **(** :ref:`int` column **)** Returns ``true`` if column ``column`` is selected. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_move_to_bottom: .. rst-class:: classref-method void **move_to_bottom** **(** **)** Moves this TreeItem to the bottom in the :ref:`Tree` hierarchy. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_move_to_top: .. rst-class:: classref-method void **move_to_top** **(** **)** Moves this TreeItem to the top in the :ref:`Tree` hierarchy. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_remove_child: .. rst-class:: classref-method void **remove_child** **(** :ref:`Object` child **)** Removes the given child **TreeItem** and all its children from the :ref:`Tree`. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a **TreeItem** use :ref:`Object.free`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_select: .. rst-class:: classref-method void **select** **(** :ref:`int` column **)** Selects the column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_button: .. rst-class:: classref-method void **set_button** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture` button **)** Sets the given column's button :ref:`Texture` at index ``button_idx`` to ``button``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_button_disabled: .. rst-class:: classref-method void **set_button_disabled** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** If ``true``, disables the button at index ``button_idx`` in column ``column``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_cell_mode: .. rst-class:: classref-method void **set_cell_mode** **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode` constants. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_checked: .. rst-class:: classref-method void **set_checked** **(** :ref:`int` column, :ref:`bool` checked **)** If ``true``, the column ``column`` is checked. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_custom_as_button: .. rst-class:: classref-method void **set_custom_as_button** **(** :ref:`int` column, :ref:`bool` enable **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_custom_bg_color: .. rst-class:: classref-method void **set_custom_bg_color** **(** :ref:`int` column, :ref:`Color` color, :ref:`bool` just_outline=false **)** Sets the given column's custom background color and whether to just use it as an outline. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_custom_color: .. rst-class:: classref-method void **set_custom_color** **(** :ref:`int` column, :ref:`Color` color **)** Sets the given column's custom color. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_custom_draw: .. rst-class:: classref-method void **set_custom_draw** **(** :ref:`int` column, :ref:`Object` object, :ref:`String` callback **)** 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 :ref:`Rect2`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_editable: .. rst-class:: classref-method void **set_editable** **(** :ref:`int` column, :ref:`bool` enabled **)** If ``true``, column ``column`` is editable. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_expand_right: .. rst-class:: classref-method void **set_expand_right** **(** :ref:`int` column, :ref:`bool` enable **)** If ``true``, column ``column`` is expanded to the right. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_icon: .. rst-class:: classref-method void **set_icon** **(** :ref:`int` column, :ref:`Texture` texture **)** Sets the given column's icon :ref:`Texture`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_icon_max_width: .. rst-class:: classref-method void **set_icon_max_width** **(** :ref:`int` column, :ref:`int` width **)** Sets the given column's icon's maximum width. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_icon_modulate: .. rst-class:: classref-method void **set_icon_modulate** **(** :ref:`int` column, :ref:`Color` modulate **)** Modulates the given column's icon with ``modulate``. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_icon_region: .. rst-class:: classref-method void **set_icon_region** **(** :ref:`int` column, :ref:`Rect2` region **)** Sets the given column's icon's texture region. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_metadata: .. rst-class:: classref-method void **set_metadata** **(** :ref:`int` column, :ref:`Variant` meta **)** Sets the metadata value for the given column, which can be retrieved later using :ref:`get_metadata`. This can be used, for example, to store a reference to the original data. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_range: .. rst-class:: classref-method void **set_range** **(** :ref:`int` column, :ref:`float` value **)** Sets the value of a :ref:`CELL_MODE_RANGE` column. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_range_config: .. rst-class:: classref-method void **set_range_config** **(** :ref:`int` column, :ref:`float` min, :ref:`float` max, :ref:`float` step, :ref:`bool` expr=false **)** Sets the range of accepted values for a column. The column must be in the :ref:`CELL_MODE_RANGE` mode. If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit`. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_selectable: .. rst-class:: classref-method void **set_selectable** **(** :ref:`int` column, :ref:`bool` selectable **)** If ``true``, the given column is selectable. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_suffix: .. rst-class:: classref-method void **set_suffix** **(** :ref:`int` column, :ref:`String` text **)** Sets a string to be shown after a column's value (for example, a unit abbreviation). .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_text: .. rst-class:: classref-method void **set_text** **(** :ref:`int` column, :ref:`String` text **)** Sets the given column's text value. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_text_align: .. rst-class:: classref-method void **set_text_align** **(** :ref:`int` column, :ref:`TextAlign` text_align **)** Sets the given column's text alignment. See :ref:`TextAlign` for possible values. .. rst-class:: classref-item-separator ---- .. _class_TreeItem_method_set_tooltip: .. rst-class:: classref-method void **set_tooltip** **(** :ref:`int` column, :ref:`String` tooltip **)** Sets the given column's tooltip text. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`