:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TreeItem.xml. .. _class_TreeItem: TreeItem ======== **Inherits:** :ref:`Object` Control for a single item inside a :ref:`Tree`. 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`. Properties ---------- +-------------------------+-----------------------------------------------------------------------------+ | :ref:`bool` | :ref:`collapsed` | +-------------------------+-----------------------------------------------------------------------------+ | :ref:`int` | :ref:`custom_minimum_height` | +-------------------------+-----------------------------------------------------------------------------+ | :ref:`bool` | :ref:`disable_folding` | +-------------------------+-----------------------------------------------------------------------------+ | :ref:`bool` | :ref:`visible` | +-------------------------+-----------------------------------------------------------------------------+ Methods ------- +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_button` **(** :ref:`int` column, :ref:`Texture2D` button, :ref:`int` id=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`call_recursive` **(** :ref:`StringName` method, ... **)** |vararg| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_custom_bg_color` **(** :ref:`int` column **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_custom_color` **(** :ref:`int` column **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`create_child` **(** :ref:`int` idx=-1 **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`deselect` **(** :ref:`int` column **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`erase_button` **(** :ref:`int` column, :ref:`int` button_idx **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :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_child` **(** :ref:`int` idx **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_child_count` **(** **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :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:`Font` | :ref:`get_custom_font` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_custom_font_size` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_expand_right` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_first_child` **(** **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture2D` | :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:`int` | :ref:`get_index` **(** **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_language` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`get_metadata` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_next` **(** **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_next_visible` **(** :ref:`bool` wrap=false **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TreeItem` | :ref:`get_parent` **(** **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :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:`StructuredTextParser` | :ref:`get_structured_text_bidi_override` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_structured_text_bidi_override_options` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_suffix` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_text` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`HorizontalAlignment` | :ref:`get_text_alignment` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TextDirection` | :ref:`get_text_direction` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_tooltip` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Tree` | :ref:`get_tree` **(** **)** |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_indeterminate` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selectable` **(** :ref:`int` column **)** |const| | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selected` **(** :ref:`int` column **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_after` **(** :ref:`TreeItem` item **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`move_before` **(** :ref:`TreeItem` item **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`propagate_check` **(** :ref:`int` column, :ref:`bool` emit_signal=true **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_child` **(** :ref:`TreeItem` child **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`select` **(** :ref:`int` column **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_button` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture2D` 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:`StringName` callback **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_font` **(** :ref:`int` column, :ref:`Font` font **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_custom_font_size` **(** :ref:`int` column, :ref:`int` font_size **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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:`Texture2D` 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_indeterminate` **(** :ref:`int` column, :ref:`bool` indeterminate **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_language` **(** :ref:`int` column, :ref:`String` language **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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_structured_text_bidi_override` **(** :ref:`int` column, :ref:`StructuredTextParser` parser **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_structured_text_bidi_override_options` **(** :ref:`int` column, :ref:`Array` args **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_suffix` **(** :ref:`int` column, :ref:`String` text **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text` **(** :ref:`int` column, :ref:`String` text **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text_alignment` **(** :ref:`int` column, :ref:`HorizontalAlignment` text_alignment **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_text_direction` **(** :ref:`int` column, :ref:`TextDirection` direction **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_tooltip` **(** :ref:`int` column, :ref:`String` tooltip **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`uncollapse_tree` **(** **)** | +-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ .. _enum_TreeItem_TreeCellMode: .. _class_TreeItem_constant_CELL_MODE_STRING: .. _class_TreeItem_constant_CELL_MODE_CHECK: .. _class_TreeItem_constant_CELL_MODE_RANGE: .. _class_TreeItem_constant_CELL_MODE_ICON: .. _class_TreeItem_constant_CELL_MODE_CUSTOM: enum **TreeCellMode**: - **CELL_MODE_STRING** = **0** --- Cell contains a string. - **CELL_MODE_CHECK** = **1** --- Cell contains a checkbox. - **CELL_MODE_RANGE** = **2** --- Cell contains a range. - **CELL_MODE_ICON** = **3** --- Cell contains an icon. - **CELL_MODE_CUSTOM** = **4** Property Descriptions --------------------- .. _class_TreeItem_property_collapsed: - :ref:`bool` **collapsed** +----------+----------------------+ | *Setter* | set_collapsed(value) | +----------+----------------------+ | *Getter* | is_collapsed() | +----------+----------------------+ If ``true``, the TreeItem is collapsed. ---- .. _class_TreeItem_property_custom_minimum_height: - :ref:`int` **custom_minimum_height** +----------+----------------------------------+ | *Setter* | set_custom_minimum_height(value) | +----------+----------------------------------+ | *Getter* | get_custom_minimum_height() | +----------+----------------------------------+ The custom minimum height. ---- .. _class_TreeItem_property_disable_folding: - :ref:`bool` **disable_folding** +----------+----------------------------+ | *Setter* | set_disable_folding(value) | +----------+----------------------------+ | *Getter* | is_folding_disabled() | +----------+----------------------------+ If ``true``, folding is disabled for this TreeItem. ---- .. _class_TreeItem_property_visible: - :ref:`bool` **visible** +----------+--------------------+ | *Setter* | set_visible(value) | +----------+--------------------+ | *Getter* | is_visible() | +----------+--------------------+ If ``true``, the ``TreeItem`` is visible (default). Note that if a ``TreeItem`` is set to not be visible, none of its children will be visible either. Method Descriptions ------------------- .. _class_TreeItem_method_add_button: - void **add_button** **(** :ref:`int` column, :ref:`Texture2D` button, :ref:`int` id=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** Adds a button with :ref:`Texture2D` ``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``. ---- .. _class_TreeItem_method_call_recursive: - void **call_recursive** **(** :ref:`StringName` method, ... **)** |vararg| Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. ---- .. _class_TreeItem_method_clear_custom_bg_color: - void **clear_custom_bg_color** **(** :ref:`int` column **)** Resets the background color for the given column to default. ---- .. _class_TreeItem_method_clear_custom_color: - void **clear_custom_color** **(** :ref:`int` column **)** Resets the color for the given column to default. ---- .. _class_TreeItem_method_create_child: - :ref:`TreeItem` **create_child** **(** :ref:`int` idx=-1 **)** Creates an item and adds it as a child. The new item will be inserted as position ``idx`` (the default value ``-1`` means the last position), or it will be the last child if ``idx`` is higher than the child count. ---- .. _class_TreeItem_method_deselect: - void **deselect** **(** :ref:`int` column **)** Deselects the given column. ---- .. _class_TreeItem_method_erase_button: - void **erase_button** **(** :ref:`int` column, :ref:`int` button_idx **)** Removes the button at index ``button_idx`` in column ``column``. ---- .. _class_TreeItem_method_get_button: - :ref:`Texture2D` **get_button** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| Returns the :ref:`Texture2D` of the button at index ``button_idx`` in column ``column``. ---- .. _class_TreeItem_method_get_button_by_id: - :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. ---- .. _class_TreeItem_method_get_button_count: - :ref:`int` **get_button_count** **(** :ref:`int` column **)** |const| Returns the number of buttons in column ``column``. ---- .. _class_TreeItem_method_get_button_id: - :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``. ---- .. _class_TreeItem_method_get_button_tooltip: - :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``. ---- .. _class_TreeItem_method_get_cell_mode: - :ref:`TreeCellMode` **get_cell_mode** **(** :ref:`int` column **)** |const| Returns the column's cell mode. ---- .. _class_TreeItem_method_get_child: - :ref:`TreeItem` **get_child** **(** :ref:`int` idx **)** Returns a child item by its index (see :ref:`get_child_count`). This method is often used for iterating all children of an item. Negative indices access the children from the last one. ---- .. _class_TreeItem_method_get_child_count: - :ref:`int` **get_child_count** **(** **)** Returns the number of child items. ---- .. _class_TreeItem_method_get_children: - :ref:`Array` **get_children** **(** **)** Returns an array of references to the item's children. ---- .. _class_TreeItem_method_get_custom_bg_color: - :ref:`Color` **get_custom_bg_color** **(** :ref:`int` column **)** |const| Returns the custom background color of column ``column``. ---- .. _class_TreeItem_method_get_custom_color: - :ref:`Color` **get_custom_color** **(** :ref:`int` column **)** |const| Returns the custom color of column ``column``. ---- .. _class_TreeItem_method_get_custom_font: - :ref:`Font` **get_custom_font** **(** :ref:`int` column **)** |const| Returns custom font used to draw text in the column ``column``. ---- .. _class_TreeItem_method_get_custom_font_size: - :ref:`int` **get_custom_font_size** **(** :ref:`int` column **)** |const| Returns custom font size used to draw text in the column ``column``. ---- .. _class_TreeItem_method_get_expand_right: - :ref:`bool` **get_expand_right** **(** :ref:`int` column **)** |const| Returns ``true`` if ``expand_right`` is set. ---- .. _class_TreeItem_method_get_first_child: - :ref:`TreeItem` **get_first_child** **(** **)** |const| Returns the TreeItem's first child. ---- .. _class_TreeItem_method_get_icon: - :ref:`Texture2D` **get_icon** **(** :ref:`int` column **)** |const| Returns the given column's icon :ref:`Texture2D`. Error if no icon is set. ---- .. _class_TreeItem_method_get_icon_max_width: - :ref:`int` **get_icon_max_width** **(** :ref:`int` column **)** |const| Returns the column's icon's maximum width. ---- .. _class_TreeItem_method_get_icon_modulate: - :ref:`Color` **get_icon_modulate** **(** :ref:`int` column **)** |const| Returns the :ref:`Color` modulating the column's icon. ---- .. _class_TreeItem_method_get_icon_region: - :ref:`Rect2` **get_icon_region** **(** :ref:`int` column **)** |const| Returns the icon :ref:`Texture2D` region as :ref:`Rect2`. ---- .. _class_TreeItem_method_get_index: - :ref:`int` **get_index** **(** **)** Returns the node's order in the tree. For example, if called on the first child item the position is ``0``. ---- .. _class_TreeItem_method_get_language: - :ref:`String` **get_language** **(** :ref:`int` column **)** |const| Returns item's text language code. ---- .. _class_TreeItem_method_get_metadata: - :ref:`Variant` **get_metadata** **(** :ref:`int` column **)** |const| Returns the metadata value that was set for the given column using :ref:`set_metadata`. ---- .. _class_TreeItem_method_get_next: - :ref:`TreeItem` **get_next** **(** **)** |const| Returns the next sibling TreeItem in the tree or a null object if there is none. ---- .. _class_TreeItem_method_get_next_visible: - :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``. ---- .. _class_TreeItem_method_get_parent: - :ref:`TreeItem` **get_parent** **(** **)** |const| Returns the parent TreeItem or a null object if there is none. ---- .. _class_TreeItem_method_get_prev: - :ref:`TreeItem` **get_prev** **(** **)** Returns the previous sibling TreeItem in the tree or a null object if there is none. ---- .. _class_TreeItem_method_get_prev_visible: - :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``. ---- .. _class_TreeItem_method_get_range: - :ref:`float` **get_range** **(** :ref:`int` column **)** |const| Returns the value of a :ref:`CELL_MODE_RANGE` column. ---- .. _class_TreeItem_method_get_range_config: - :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". ---- .. _class_TreeItem_method_get_structured_text_bidi_override: - :ref:`StructuredTextParser` **get_structured_text_bidi_override** **(** :ref:`int` column **)** |const| ---- .. _class_TreeItem_method_get_structured_text_bidi_override_options: - :ref:`Array` **get_structured_text_bidi_override_options** **(** :ref:`int` column **)** |const| ---- .. _class_TreeItem_method_get_suffix: - :ref:`String` **get_suffix** **(** :ref:`int` column **)** |const| Gets the suffix string shown after the column value. ---- .. _class_TreeItem_method_get_text: - :ref:`String` **get_text** **(** :ref:`int` column **)** |const| Returns the given column's text. ---- .. _class_TreeItem_method_get_text_alignment: - :ref:`HorizontalAlignment` **get_text_alignment** **(** :ref:`int` column **)** |const| Returns the given column's text alignment. ---- .. _class_TreeItem_method_get_text_direction: - :ref:`TextDirection` **get_text_direction** **(** :ref:`int` column **)** |const| Returns item's text base writing direction. ---- .. _class_TreeItem_method_get_tooltip: - :ref:`String` **get_tooltip** **(** :ref:`int` column **)** |const| Returns the given column's tooltip. ---- .. _class_TreeItem_method_get_tree: - :ref:`Tree` **get_tree** **(** **)** |const| Returns the :ref:`Tree` that owns this TreeItem. ---- .. _class_TreeItem_method_is_button_disabled: - :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. ---- .. _class_TreeItem_method_is_checked: - :ref:`bool` **is_checked** **(** :ref:`int` column **)** |const| Returns ``true`` if the given column is checked. ---- .. _class_TreeItem_method_is_custom_set_as_button: - :ref:`bool` **is_custom_set_as_button** **(** :ref:`int` column **)** |const| ---- .. _class_TreeItem_method_is_editable: - :ref:`bool` **is_editable** **(** :ref:`int` column **)** Returns ``true`` if column ``column`` is editable. ---- .. _class_TreeItem_method_is_indeterminate: - :ref:`bool` **is_indeterminate** **(** :ref:`int` column **)** |const| Returns ``true`` if the given column is indeterminate. ---- .. _class_TreeItem_method_is_selectable: - :ref:`bool` **is_selectable** **(** :ref:`int` column **)** |const| Returns ``true`` if column ``column`` is selectable. ---- .. _class_TreeItem_method_is_selected: - :ref:`bool` **is_selected** **(** :ref:`int` column **)** Returns ``true`` if column ``column`` is selected. ---- .. _class_TreeItem_method_move_after: - void **move_after** **(** :ref:`TreeItem` item **)** Moves this TreeItem right after the given ``item``. \ **Note:** You can't move to the root or move the root. ---- .. _class_TreeItem_method_move_before: - void **move_before** **(** :ref:`TreeItem` item **)** Moves this TreeItem right before the given ``item``. \ **Note:** You can't move to the root or move the root. ---- .. _class_TreeItem_method_propagate_check: - void **propagate_check** **(** :ref:`int` column, :ref:`bool` emit_signal=true **)** 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 :ref:`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 :ref:`Tree.check_propagated_to_item` will not be emitted. ---- .. _class_TreeItem_method_remove_child: - void **remove_child** **(** :ref:`TreeItem` 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`. ---- .. _class_TreeItem_method_select: - void **select** **(** :ref:`int` column **)** Selects the column ``column``. ---- .. _class_TreeItem_method_set_button: - void **set_button** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture2D` button **)** Sets the given column's button :ref:`Texture2D` at index ``button_idx`` to ``button``. ---- .. _class_TreeItem_method_set_button_disabled: - 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``. ---- .. _class_TreeItem_method_set_cell_mode: - void **set_cell_mode** **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode` constants. ---- .. _class_TreeItem_method_set_checked: - void **set_checked** **(** :ref:`int` column, :ref:`bool` checked **)** If ``true``, the column ``column`` is checked. Clears column's indeterminate status. ---- .. _class_TreeItem_method_set_custom_as_button: - void **set_custom_as_button** **(** :ref:`int` column, :ref:`bool` enable **)** ---- .. _class_TreeItem_method_set_custom_bg_color: - 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. ---- .. _class_TreeItem_method_set_custom_color: - void **set_custom_color** **(** :ref:`int` column, :ref:`Color` color **)** Sets the given column's custom color. ---- .. _class_TreeItem_method_set_custom_draw: - void **set_custom_draw** **(** :ref:`int` column, :ref:`Object` object, :ref:`StringName` 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`. ---- .. _class_TreeItem_method_set_custom_font: - void **set_custom_font** **(** :ref:`int` column, :ref:`Font` font **)** Sets custom font used to draw text in the column ``column``. ---- .. _class_TreeItem_method_set_custom_font_size: - void **set_custom_font_size** **(** :ref:`int` column, :ref:`int` font_size **)** Sets custom font size used to draw text in the column ``column``. ---- .. _class_TreeItem_method_set_editable: - void **set_editable** **(** :ref:`int` column, :ref:`bool` enabled **)** If ``true``, column ``column`` is editable. ---- .. _class_TreeItem_method_set_expand_right: - void **set_expand_right** **(** :ref:`int` column, :ref:`bool` enable **)** If ``true``, column ``column`` is expanded to the right. ---- .. _class_TreeItem_method_set_icon: - void **set_icon** **(** :ref:`int` column, :ref:`Texture2D` texture **)** Sets the given column's icon :ref:`Texture2D`. ---- .. _class_TreeItem_method_set_icon_max_width: - void **set_icon_max_width** **(** :ref:`int` column, :ref:`int` width **)** Sets the given column's icon's maximum width. ---- .. _class_TreeItem_method_set_icon_modulate: - void **set_icon_modulate** **(** :ref:`int` column, :ref:`Color` modulate **)** Modulates the given column's icon with ``modulate``. ---- .. _class_TreeItem_method_set_icon_region: - void **set_icon_region** **(** :ref:`int` column, :ref:`Rect2` region **)** Sets the given column's icon's texture region. ---- .. _class_TreeItem_method_set_indeterminate: - void **set_indeterminate** **(** :ref:`int` column, :ref:`bool` indeterminate **)** If ``true``, the column ``column`` is marked indeterminate. \ **Note:** If set ``true`` from ``false``, then column is cleared of checked status. ---- .. _class_TreeItem_method_set_language: - void **set_language** **(** :ref:`int` column, :ref:`String` language **)** Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. ---- .. _class_TreeItem_method_set_metadata: - 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. ---- .. _class_TreeItem_method_set_range: - void **set_range** **(** :ref:`int` column, :ref:`float` value **)** Sets the value of a :ref:`CELL_MODE_RANGE` column. ---- .. _class_TreeItem_method_set_range_config: - 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`. ---- .. _class_TreeItem_method_set_selectable: - void **set_selectable** **(** :ref:`int` column, :ref:`bool` selectable **)** If ``true``, the given column is selectable. ---- .. _class_TreeItem_method_set_structured_text_bidi_override: - void **set_structured_text_bidi_override** **(** :ref:`int` column, :ref:`StructuredTextParser` parser **)** ---- .. _class_TreeItem_method_set_structured_text_bidi_override_options: - void **set_structured_text_bidi_override_options** **(** :ref:`int` column, :ref:`Array` args **)** ---- .. _class_TreeItem_method_set_suffix: - 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). ---- .. _class_TreeItem_method_set_text: - void **set_text** **(** :ref:`int` column, :ref:`String` text **)** Sets the given column's text value. ---- .. _class_TreeItem_method_set_text_alignment: - void **set_text_alignment** **(** :ref:`int` column, :ref:`HorizontalAlignment` text_alignment **)** Sets the given column's text alignment. See :ref:`HorizontalAlignment` for possible values. ---- .. _class_TreeItem_method_set_text_direction: - void **set_text_direction** **(** :ref:`int` column, :ref:`TextDirection` direction **)** Sets item's text base writing direction. ---- .. _class_TreeItem_method_set_tooltip: - void **set_tooltip** **(** :ref:`int` column, :ref:`String` tooltip **)** Sets the given column's tooltip text. ---- .. _class_TreeItem_method_uncollapse_tree: - void **uncollapse_tree** **(** **)** .. |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.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`