Skip to content

Latest commit

Β 

History

History
2068 lines (1175 loc) Β· 104 KB

class_tree.rst

File metadata and controls

2068 lines (1175 loc) Β· 104 KB
github_url:hide

Tree

Inherits: :ref:`Control<class_Control>` < :ref:`CanvasItem<class_CanvasItem>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`

A control used to show a set of internal :ref:`TreeItem<class_TreeItem>`s in a hierarchical structure.

.. rst-class:: classref-introduction-group

Description

A control used to show a set of internal :ref:`TreeItem<class_TreeItem>`s in a hierarchical structure. The tree items can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like :ref:`LineEdit<class_LineEdit>`s, buttons and popups. It can be useful for structured displays and interactions.

Trees are built via code, using :ref:`TreeItem<class_TreeItem>` objects to create the structure. They have a single root, but multiple roots can be simulated with :ref:`hide_root<class_Tree_property_hide_root>`:

.. tabs::

 .. code-tab:: gdscript

    func _ready():
        var tree = Tree.new()
        var root = tree.create_item()
        tree.hide_root = true
        var child1 = tree.create_item(root)
        var child2 = tree.create_item(root)
        var subchild1 = tree.create_item(child1)
        subchild1.set_text(0, "Subchild1")

 .. code-tab:: csharp

    public override void _Ready()
    {
        var tree = new Tree();
        TreeItem root = tree.CreateItem();
        tree.HideRoot = true;
        TreeItem child1 = tree.CreateItem(root);
        TreeItem child2 = tree.CreateItem(root);
        TreeItem subchild1 = tree.CreateItem(child1);
        subchild1.SetText(0, "Subchild1");
    }



To iterate over all the :ref:`TreeItem<class_TreeItem>` objects in a Tree object, use :ref:`TreeItem.get_next<class_TreeItem_method_get_next>` and :ref:`TreeItem.get_first_child<class_TreeItem_method_get_first_child>` after getting the root through :ref:`get_root<class_Tree_method_get_root>`. You can use :ref:`Object.free<class_Object_method_free>` on a :ref:`TreeItem<class_TreeItem>` to remove it from the Tree.

Incremental search: Like :ref:`ItemList<class_ItemList>` and :ref:`PopupMenu<class_PopupMenu>`, Tree supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing :ref:`ProjectSettings.gui/timers/incremental_search_max_interval_msec<class_ProjectSettings_property_gui/timers/incremental_search_max_interval_msec>`.

.. rst-class:: classref-reftable-group

Properties

:ref:`bool<class_bool>` :ref:`allow_reselect<class_Tree_property_allow_reselect>` false
:ref:`bool<class_bool>` :ref:`allow_rmb_select<class_Tree_property_allow_rmb_select>` false
:ref:`bool<class_bool>` :ref:`allow_search<class_Tree_property_allow_search>` true
:ref:`bool<class_bool>` clip_contents true (overrides :ref:`Control<class_Control_property_clip_contents>`)
:ref:`bool<class_bool>` :ref:`column_titles_visible<class_Tree_property_column_titles_visible>` false
:ref:`int<class_int>` :ref:`columns<class_Tree_property_columns>` 1
:ref:`int<class_int>` :ref:`drop_mode_flags<class_Tree_property_drop_mode_flags>` 0
:ref:`bool<class_bool>` :ref:`enable_recursive_folding<class_Tree_property_enable_recursive_folding>` true
:ref:`FocusMode<enum_Control_FocusMode>` focus_mode 2 (overrides :ref:`Control<class_Control_property_focus_mode>`)
:ref:`bool<class_bool>` :ref:`hide_folding<class_Tree_property_hide_folding>` false
:ref:`bool<class_bool>` :ref:`hide_root<class_Tree_property_hide_root>` false
:ref:`bool<class_bool>` :ref:`scroll_horizontal_enabled<class_Tree_property_scroll_horizontal_enabled>` true
:ref:`bool<class_bool>` :ref:`scroll_vertical_enabled<class_Tree_property_scroll_vertical_enabled>` true
:ref:`SelectMode<enum_Tree_SelectMode>` :ref:`select_mode<class_Tree_property_select_mode>` 0
.. rst-class:: classref-reftable-group

Methods

|void| :ref:`clear<class_Tree_method_clear>`()
:ref:`TreeItem<class_TreeItem>` :ref:`create_item<class_Tree_method_create_item>`(parent: :ref:`TreeItem<class_TreeItem>` = null, index: :ref:`int<class_int>` = -1)
|void| :ref:`deselect_all<class_Tree_method_deselect_all>`()
:ref:`bool<class_bool>` :ref:`edit_selected<class_Tree_method_edit_selected>`(force_edit: :ref:`bool<class_bool>` = false)
|void| :ref:`ensure_cursor_is_visible<class_Tree_method_ensure_cursor_is_visible>`()
:ref:`int<class_int>` :ref:`get_button_id_at_position<class_Tree_method_get_button_id_at_position>`(position: :ref:`Vector2<class_Vector2>`) |const|
:ref:`int<class_int>` :ref:`get_column_at_position<class_Tree_method_get_column_at_position>`(position: :ref:`Vector2<class_Vector2>`) |const|
:ref:`int<class_int>` :ref:`get_column_expand_ratio<class_Tree_method_get_column_expand_ratio>`(column: :ref:`int<class_int>`) |const|
:ref:`String<class_String>` :ref:`get_column_title<class_Tree_method_get_column_title>`(column: :ref:`int<class_int>`) |const|
:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` :ref:`get_column_title_alignment<class_Tree_method_get_column_title_alignment>`(column: :ref:`int<class_int>`) |const|
:ref:`TextDirection<enum_Control_TextDirection>` :ref:`get_column_title_direction<class_Tree_method_get_column_title_direction>`(column: :ref:`int<class_int>`) |const|
:ref:`String<class_String>` :ref:`get_column_title_language<class_Tree_method_get_column_title_language>`(column: :ref:`int<class_int>`) |const|
:ref:`int<class_int>` :ref:`get_column_width<class_Tree_method_get_column_width>`(column: :ref:`int<class_int>`) |const|
:ref:`Rect2<class_Rect2>` :ref:`get_custom_popup_rect<class_Tree_method_get_custom_popup_rect>`() |const|
:ref:`int<class_int>` :ref:`get_drop_section_at_position<class_Tree_method_get_drop_section_at_position>`(position: :ref:`Vector2<class_Vector2>`) |const|
:ref:`TreeItem<class_TreeItem>` :ref:`get_edited<class_Tree_method_get_edited>`() |const|
:ref:`int<class_int>` :ref:`get_edited_column<class_Tree_method_get_edited_column>`() |const|
:ref:`Rect2<class_Rect2>` :ref:`get_item_area_rect<class_Tree_method_get_item_area_rect>`(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>` = -1, button_index: :ref:`int<class_int>` = -1) |const|
:ref:`TreeItem<class_TreeItem>` :ref:`get_item_at_position<class_Tree_method_get_item_at_position>`(position: :ref:`Vector2<class_Vector2>`) |const|
:ref:`TreeItem<class_TreeItem>` :ref:`get_next_selected<class_Tree_method_get_next_selected>`(from: :ref:`TreeItem<class_TreeItem>`)
:ref:`int<class_int>` :ref:`get_pressed_button<class_Tree_method_get_pressed_button>`() |const|
:ref:`TreeItem<class_TreeItem>` :ref:`get_root<class_Tree_method_get_root>`() |const|
:ref:`Vector2<class_Vector2>` :ref:`get_scroll<class_Tree_method_get_scroll>`() |const|
:ref:`TreeItem<class_TreeItem>` :ref:`get_selected<class_Tree_method_get_selected>`() |const|
:ref:`int<class_int>` :ref:`get_selected_column<class_Tree_method_get_selected_column>`() |const|
:ref:`bool<class_bool>` :ref:`is_column_clipping_content<class_Tree_method_is_column_clipping_content>`(column: :ref:`int<class_int>`) |const|
:ref:`bool<class_bool>` :ref:`is_column_expanding<class_Tree_method_is_column_expanding>`(column: :ref:`int<class_int>`) |const|
|void| :ref:`scroll_to_item<class_Tree_method_scroll_to_item>`(item: :ref:`TreeItem<class_TreeItem>`, center_on_item: :ref:`bool<class_bool>` = false)
|void| :ref:`set_column_clip_content<class_Tree_method_set_column_clip_content>`(column: :ref:`int<class_int>`, enable: :ref:`bool<class_bool>`)
|void| :ref:`set_column_custom_minimum_width<class_Tree_method_set_column_custom_minimum_width>`(column: :ref:`int<class_int>`, min_width: :ref:`int<class_int>`)
|void| :ref:`set_column_expand<class_Tree_method_set_column_expand>`(column: :ref:`int<class_int>`, expand: :ref:`bool<class_bool>`)
|void| :ref:`set_column_expand_ratio<class_Tree_method_set_column_expand_ratio>`(column: :ref:`int<class_int>`, ratio: :ref:`int<class_int>`)
|void| :ref:`set_column_title<class_Tree_method_set_column_title>`(column: :ref:`int<class_int>`, title: :ref:`String<class_String>`)
|void| :ref:`set_column_title_alignment<class_Tree_method_set_column_title_alignment>`(column: :ref:`int<class_int>`, title_alignment: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`)
|void| :ref:`set_column_title_direction<class_Tree_method_set_column_title_direction>`(column: :ref:`int<class_int>`, direction: :ref:`TextDirection<enum_Control_TextDirection>`)
|void| :ref:`set_column_title_language<class_Tree_method_set_column_title_language>`(column: :ref:`int<class_int>`, language: :ref:`String<class_String>`)
|void| :ref:`set_selected<class_Tree_method_set_selected>`(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>`)
.. rst-class:: classref-reftable-group

Theme Properties

:ref:`Color<class_Color>` :ref:`children_hl_line_color<class_Tree_theme_color_children_hl_line_color>` Color(0.27, 0.27, 0.27, 1)
:ref:`Color<class_Color>` :ref:`custom_button_font_highlight<class_Tree_theme_color_custom_button_font_highlight>` Color(0.95, 0.95, 0.95, 1)
:ref:`Color<class_Color>` :ref:`drop_position_color<class_Tree_theme_color_drop_position_color>` Color(1, 1, 1, 1)
:ref:`Color<class_Color>` :ref:`font_color<class_Tree_theme_color_font_color>` Color(0.7, 0.7, 0.7, 1)
:ref:`Color<class_Color>` :ref:`font_disabled_color<class_Tree_theme_color_font_disabled_color>` Color(0.875, 0.875, 0.875, 0.5)
:ref:`Color<class_Color>` :ref:`font_outline_color<class_Tree_theme_color_font_outline_color>` Color(0, 0, 0, 1)
:ref:`Color<class_Color>` :ref:`font_selected_color<class_Tree_theme_color_font_selected_color>` Color(1, 1, 1, 1)
:ref:`Color<class_Color>` :ref:`guide_color<class_Tree_theme_color_guide_color>` Color(0.7, 0.7, 0.7, 0.25)
:ref:`Color<class_Color>` :ref:`parent_hl_line_color<class_Tree_theme_color_parent_hl_line_color>` Color(0.27, 0.27, 0.27, 1)
:ref:`Color<class_Color>` :ref:`relationship_line_color<class_Tree_theme_color_relationship_line_color>` Color(0.27, 0.27, 0.27, 1)
:ref:`Color<class_Color>` :ref:`title_button_color<class_Tree_theme_color_title_button_color>` Color(0.875, 0.875, 0.875, 1)
:ref:`int<class_int>` :ref:`button_margin<class_Tree_theme_constant_button_margin>` 4
:ref:`int<class_int>` :ref:`children_hl_line_width<class_Tree_theme_constant_children_hl_line_width>` 1
:ref:`int<class_int>` :ref:`draw_guides<class_Tree_theme_constant_draw_guides>` 1
:ref:`int<class_int>` :ref:`draw_relationship_lines<class_Tree_theme_constant_draw_relationship_lines>` 0
:ref:`int<class_int>` :ref:`h_separation<class_Tree_theme_constant_h_separation>` 4
:ref:`int<class_int>` :ref:`icon_max_width<class_Tree_theme_constant_icon_max_width>` 0
:ref:`int<class_int>` :ref:`inner_item_margin_bottom<class_Tree_theme_constant_inner_item_margin_bottom>` 0
:ref:`int<class_int>` :ref:`inner_item_margin_left<class_Tree_theme_constant_inner_item_margin_left>` 0
:ref:`int<class_int>` :ref:`inner_item_margin_right<class_Tree_theme_constant_inner_item_margin_right>` 0
:ref:`int<class_int>` :ref:`inner_item_margin_top<class_Tree_theme_constant_inner_item_margin_top>` 0
:ref:`int<class_int>` :ref:`item_margin<class_Tree_theme_constant_item_margin>` 16
:ref:`int<class_int>` :ref:`outline_size<class_Tree_theme_constant_outline_size>` 0
:ref:`int<class_int>` :ref:`parent_hl_line_margin<class_Tree_theme_constant_parent_hl_line_margin>` 0
:ref:`int<class_int>` :ref:`parent_hl_line_width<class_Tree_theme_constant_parent_hl_line_width>` 1
:ref:`int<class_int>` :ref:`relationship_line_width<class_Tree_theme_constant_relationship_line_width>` 1
:ref:`int<class_int>` :ref:`scroll_border<class_Tree_theme_constant_scroll_border>` 4
:ref:`int<class_int>` :ref:`scroll_speed<class_Tree_theme_constant_scroll_speed>` 12
:ref:`int<class_int>` :ref:`scrollbar_h_separation<class_Tree_theme_constant_scrollbar_h_separation>` 4
:ref:`int<class_int>` :ref:`scrollbar_margin_bottom<class_Tree_theme_constant_scrollbar_margin_bottom>` -1
:ref:`int<class_int>` :ref:`scrollbar_margin_left<class_Tree_theme_constant_scrollbar_margin_left>` -1
:ref:`int<class_int>` :ref:`scrollbar_margin_right<class_Tree_theme_constant_scrollbar_margin_right>` -1
:ref:`int<class_int>` :ref:`scrollbar_margin_top<class_Tree_theme_constant_scrollbar_margin_top>` -1
:ref:`int<class_int>` :ref:`scrollbar_v_separation<class_Tree_theme_constant_scrollbar_v_separation>` 4
:ref:`int<class_int>` :ref:`v_separation<class_Tree_theme_constant_v_separation>` 4
:ref:`Font<class_Font>` :ref:`font<class_Tree_theme_font_font>` Β 
:ref:`Font<class_Font>` :ref:`title_button_font<class_Tree_theme_font_title_button_font>` Β 
:ref:`int<class_int>` :ref:`font_size<class_Tree_theme_font_size_font_size>` Β 
:ref:`int<class_int>` :ref:`title_button_font_size<class_Tree_theme_font_size_title_button_font_size>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`arrow<class_Tree_theme_icon_arrow>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`arrow_collapsed<class_Tree_theme_icon_arrow_collapsed>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`arrow_collapsed_mirrored<class_Tree_theme_icon_arrow_collapsed_mirrored>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`checked<class_Tree_theme_icon_checked>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`checked_disabled<class_Tree_theme_icon_checked_disabled>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`indeterminate<class_Tree_theme_icon_indeterminate>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`indeterminate_disabled<class_Tree_theme_icon_indeterminate_disabled>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`select_arrow<class_Tree_theme_icon_select_arrow>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`unchecked<class_Tree_theme_icon_unchecked>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`unchecked_disabled<class_Tree_theme_icon_unchecked_disabled>` Β 
:ref:`Texture2D<class_Texture2D>` :ref:`updown<class_Tree_theme_icon_updown>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`button_pressed<class_Tree_theme_style_button_pressed>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`cursor<class_Tree_theme_style_cursor>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`cursor_unfocused<class_Tree_theme_style_cursor_unfocused>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`custom_button<class_Tree_theme_style_custom_button>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`custom_button_hover<class_Tree_theme_style_custom_button_hover>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`custom_button_pressed<class_Tree_theme_style_custom_button_pressed>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`focus<class_Tree_theme_style_focus>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`panel<class_Tree_theme_style_panel>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`selected<class_Tree_theme_style_selected>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`selected_focus<class_Tree_theme_style_selected_focus>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`title_button_hover<class_Tree_theme_style_title_button_hover>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`title_button_normal<class_Tree_theme_style_title_button_normal>` Β 
:ref:`StyleBox<class_StyleBox>` :ref:`title_button_pressed<class_Tree_theme_style_title_button_pressed>` Β 
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Signals

.. rst-class:: classref-signal

button_clicked(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>`, id: :ref:`int<class_int>`, mouse_button_index: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_button_clicked>`

Emitted when a button on the tree was pressed (see :ref:`TreeItem.add_button<class_TreeItem_method_add_button>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

cell_selected() :ref:`πŸ”—<class_Tree_signal_cell_selected>`

Emitted when a cell is selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

check_propagated_to_item(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_check_propagated_to_item>`

Emitted when :ref:`TreeItem.propagate_check<class_TreeItem_method_propagate_check>` is called. Connect to this signal to process the items that are affected when :ref:`TreeItem.propagate_check<class_TreeItem_method_propagate_check>` is invoked. The order that the items affected will be processed is as follows: the item that invoked the method, children of that item, and finally parents of that item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

column_title_clicked(column: :ref:`int<class_int>`, mouse_button_index: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_column_title_clicked>`

Emitted when a column's title is clicked with either :ref:`@GlobalScope.MOUSE_BUTTON_LEFT<class_@GlobalScope_constant_MOUSE_BUTTON_LEFT>` or :ref:`@GlobalScope.MOUSE_BUTTON_RIGHT<class_@GlobalScope_constant_MOUSE_BUTTON_RIGHT>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

custom_item_clicked(mouse_button_index: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_custom_item_clicked>`

Emitted when an item with :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked with a mouse button.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

custom_popup_edited(arrow_clicked: :ref:`bool<class_bool>`) :ref:`πŸ”—<class_Tree_signal_custom_popup_edited>`

Emitted when a cell with the :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` is clicked to be edited.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

empty_clicked(click_position: :ref:`Vector2<class_Vector2>`, mouse_button_index: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_empty_clicked>`

Emitted when a mouse button is clicked in the empty space of the tree.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_activated() :ref:`πŸ”—<class_Tree_signal_item_activated>`

Emitted when an item is double-clicked, or selected with a ui_accept input event (e.g. using Enter or Space on the keyboard).

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_collapsed(item: :ref:`TreeItem<class_TreeItem>`) :ref:`πŸ”—<class_Tree_signal_item_collapsed>`

Emitted when an item is collapsed by a click on the folding arrow.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_edited() :ref:`πŸ”—<class_Tree_signal_item_edited>`

Emitted when an item is edited.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_icon_double_clicked() :ref:`πŸ”—<class_Tree_signal_item_icon_double_clicked>`

Emitted when an item's icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see :ref:`item_activated<class_Tree_signal_item_activated>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_mouse_selected(mouse_position: :ref:`Vector2<class_Vector2>`, mouse_button_index: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_signal_item_mouse_selected>`

Emitted when an item is selected with a mouse button.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

item_selected() :ref:`πŸ”—<class_Tree_signal_item_selected>`

Emitted when an item is selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

multi_selected(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>`, selected: :ref:`bool<class_bool>`) :ref:`πŸ”—<class_Tree_signal_multi_selected>`

Emitted instead of :ref:`item_selected<class_Tree_signal_item_selected>` if :ref:`select_mode<class_Tree_property_select_mode>` is set to :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-signal

nothing_selected() :ref:`πŸ”—<class_Tree_signal_nothing_selected>`

Emitted when a left mouse button click does not select any item.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Enumerations

.. rst-class:: classref-enumeration

enum SelectMode: :ref:`πŸ”—<enum_Tree_SelectMode>`

.. rst-class:: classref-enumeration-constant

:ref:`SelectMode<enum_Tree_SelectMode>` SELECT_SINGLE = 0

Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item.

The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item.

.. rst-class:: classref-enumeration-constant

:ref:`SelectMode<enum_Tree_SelectMode>` SELECT_ROW = 1

Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item.

The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item.

.. rst-class:: classref-enumeration-constant

:ref:`SelectMode<enum_Tree_SelectMode>` SELECT_MULTI = 2

Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item.

The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-enumeration

enum DropModeFlags: :ref:`πŸ”—<enum_Tree_DropModeFlags>`

.. rst-class:: classref-enumeration-constant

:ref:`DropModeFlags<enum_Tree_DropModeFlags>` DROP_MODE_DISABLED = 0

Disables all drop sections, but still allows to detect the "on item" drop section by :ref:`get_drop_section_at_position<class_Tree_method_get_drop_section_at_position>`.

Note: This is the default flag, it has no effect when combined with other flags.

.. rst-class:: classref-enumeration-constant

:ref:`DropModeFlags<enum_Tree_DropModeFlags>` DROP_MODE_ON_ITEM = 1

Enables the "on item" drop section. This drop section covers the entire item.

When combined with :ref:`DROP_MODE_INBETWEEN<class_Tree_constant_DROP_MODE_INBETWEEN>`, this drop section halves the height and stays centered vertically.

.. rst-class:: classref-enumeration-constant

:ref:`DropModeFlags<enum_Tree_DropModeFlags>` DROP_MODE_INBETWEEN = 2

Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, and the "below item" drop section covers the bottom half.

When combined with :ref:`DROP_MODE_ON_ITEM<class_Tree_constant_DROP_MODE_ON_ITEM>`, these drop sections halves the height and stays on top / bottom accordingly.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Property Descriptions

.. rst-class:: classref-property

:ref:`bool<class_bool>` allow_reselect = false :ref:`πŸ”—<class_Tree_property_allow_reselect>`

.. rst-class:: classref-property-setget

If true, the currently selected cell may be selected again.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` allow_rmb_select = false :ref:`πŸ”—<class_Tree_property_allow_rmb_select>`

.. rst-class:: classref-property-setget

If true, a right mouse button click can select items.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` allow_search = true :ref:`πŸ”—<class_Tree_property_allow_search>`

.. rst-class:: classref-property-setget

If true, allows navigating the Tree with letter keys through incremental search.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` column_titles_visible = false :ref:`πŸ”—<class_Tree_property_column_titles_visible>`

.. rst-class:: classref-property-setget

If true, column titles are visible.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`int<class_int>` columns = 1 :ref:`πŸ”—<class_Tree_property_columns>`

.. rst-class:: classref-property-setget

The number of columns.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`int<class_int>` drop_mode_flags = 0 :ref:`πŸ”—<class_Tree_property_drop_mode_flags>`

.. rst-class:: classref-property-setget

The drop mode as an OR combination of flags. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` constants. Once dropping is done, reverts to :ref:`DROP_MODE_DISABLED<class_Tree_constant_DROP_MODE_DISABLED>`. Setting this during :ref:`Control._can_drop_data<class_Control_private_method__can_drop_data>` is recommended.

This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` enable_recursive_folding = true :ref:`πŸ”—<class_Tree_property_enable_recursive_folding>`

.. rst-class:: classref-property-setget

If true, recursive folding is enabled for this Tree. Holding down Shift while clicking the fold arrow or using ui_right/ui_left shortcuts collapses or uncollapses the :ref:`TreeItem<class_TreeItem>` and all its descendants.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` hide_folding = false :ref:`πŸ”—<class_Tree_property_hide_folding>`

.. rst-class:: classref-property-setget

If true, the folding arrow is hidden.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` hide_root = false :ref:`πŸ”—<class_Tree_property_hide_root>`

.. rst-class:: classref-property-setget

If true, the tree's root is hidden.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` scroll_horizontal_enabled = true :ref:`πŸ”—<class_Tree_property_scroll_horizontal_enabled>`

.. rst-class:: classref-property-setget

If true, enables horizontal scrolling.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` scroll_vertical_enabled = true :ref:`πŸ”—<class_Tree_property_scroll_vertical_enabled>`

.. rst-class:: classref-property-setget

If true, enables vertical scrolling.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`SelectMode<enum_Tree_SelectMode>` select_mode = 0 :ref:`πŸ”—<class_Tree_property_select_mode>`

.. rst-class:: classref-property-setget

Allows single or multiple selection. See the :ref:`SelectMode<enum_Tree_SelectMode>` constants.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Method Descriptions

.. rst-class:: classref-method

|void| clear() :ref:`πŸ”—<class_Tree_method_clear>`

Clears the tree. This removes all items.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` create_item(parent: :ref:`TreeItem<class_TreeItem>` = null, index: :ref:`int<class_int>` = -1) :ref:`πŸ”—<class_Tree_method_create_item>`

Creates an item in the tree and adds it as a child of parent, which can be either a valid :ref:`TreeItem<class_TreeItem>` or null.

If parent is null, the root item will be the parent, or the new item will be the root itself if the tree is empty.

The new item will be the index-th child of parent, or it will be the last child if there are not enough siblings.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| deselect_all() :ref:`πŸ”—<class_Tree_method_deselect_all>`

Deselects all tree items (rows and columns). In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode also removes selection cursor.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` edit_selected(force_edit: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Tree_method_edit_selected>`

Edits the selected tree item as if it was clicked.

Either the item must be set editable with :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>` or force_edit must be true.

Returns true if the item could be edited. Fails if no item is selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| ensure_cursor_is_visible() :ref:`πŸ”—<class_Tree_method_ensure_cursor_is_visible>`

Makes the currently focused cell visible.

This will scroll the tree if necessary. In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically.

Note: Despite the name of this method, the focus cursor itself is only visible in :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_button_id_at_position(position: :ref:`Vector2<class_Vector2>`) |const| :ref:`πŸ”—<class_Tree_method_get_button_id_at_position>`

Returns the button ID at position, or -1 if no button is there.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_column_at_position(position: :ref:`Vector2<class_Vector2>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_at_position>`

Returns the column index at position, or -1 if no item is there.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_column_expand_ratio(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_expand_ratio>`

Returns the expand ratio assigned to the column.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`String<class_String>` get_column_title(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_title>`

Returns the column's title.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` get_column_title_alignment(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_title_alignment>`

Returns the column title alignment.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TextDirection<enum_Control_TextDirection>` get_column_title_direction(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_title_direction>`

Returns column title base writing direction.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`String<class_String>` get_column_title_language(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_title_language>`

Returns column title language code.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_column_width(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_get_column_width>`

Returns the column's width in pixels.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Rect2<class_Rect2>` get_custom_popup_rect() |const| :ref:`πŸ”—<class_Tree_method_get_custom_popup_rect>`

Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See :ref:`TreeItem.set_cell_mode<class_TreeItem_method_set_cell_mode>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_drop_section_at_position(position: :ref:`Vector2<class_Vector2>`) |const| :ref:`πŸ”—<class_Tree_method_get_drop_section_at_position>`

Returns the drop section at position, or -100 if no item is there.

Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` for a description of each drop section.

To get the item which the returned drop section is relative to, use :ref:`get_item_at_position<class_Tree_method_get_item_at_position>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` get_edited() |const| :ref:`πŸ”—<class_Tree_method_get_edited>`

Returns the currently edited item. Can be used with :ref:`item_edited<class_Tree_signal_item_edited>` to get the item that was modified.

.. tabs::

 .. code-tab:: gdscript

    func _ready():
        $Tree.item_edited.connect(on_Tree_item_edited)

    func on_Tree_item_edited():
        print($Tree.get_edited()) # This item just got edited (e.g. checked).

 .. code-tab:: csharp

    public override void _Ready()
    {
        GetNode<Tree>("Tree").ItemEdited += OnTreeItemEdited;
    }

    public void OnTreeItemEdited()
    {
        GD.Print(GetNode<Tree>("Tree").GetEdited()); // This item just got edited (e.g. checked).
    }



.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_edited_column() |const| :ref:`πŸ”—<class_Tree_method_get_edited_column>`

Returns the column for the currently edited item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Rect2<class_Rect2>` get_item_area_rect(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>` = -1, button_index: :ref:`int<class_int>` = -1) |const| :ref:`πŸ”—<class_Tree_method_get_item_area_rect>`

Returns the rectangle area for the specified :ref:`TreeItem<class_TreeItem>`. If column is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` get_item_at_position(position: :ref:`Vector2<class_Vector2>`) |const| :ref:`πŸ”—<class_Tree_method_get_item_at_position>`

Returns the tree item at the specified position (relative to the tree origin position).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` get_next_selected(from: :ref:`TreeItem<class_TreeItem>`) :ref:`πŸ”—<class_Tree_method_get_next_selected>`

Returns the next selected :ref:`TreeItem<class_TreeItem>` after the given one, or null if the end is reached.

If from is null, this returns the first selected item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_pressed_button() |const| :ref:`πŸ”—<class_Tree_method_get_pressed_button>`

Returns the last pressed button's index.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` get_root() |const| :ref:`πŸ”—<class_Tree_method_get_root>`

Returns the tree's root item, or null if the tree is empty.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`Vector2<class_Vector2>` get_scroll() |const| :ref:`πŸ”—<class_Tree_method_get_scroll>`

Returns the current scrolling position.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`TreeItem<class_TreeItem>` get_selected() |const| :ref:`πŸ”—<class_Tree_method_get_selected>`

Returns the currently focused item, or null if no item is focused.

In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` and :ref:`SELECT_SINGLE<class_Tree_constant_SELECT_SINGLE>` modes, the focused item is same as the selected item. In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode, the focused item is the item under the focus cursor, not necessarily selected.

To get the currently selected item(s), use :ref:`get_next_selected<class_Tree_method_get_next_selected>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`int<class_int>` get_selected_column() |const| :ref:`πŸ”—<class_Tree_method_get_selected_column>`

Returns the currently focused column, or -1 if no column is focused.

In :ref:`SELECT_SINGLE<class_Tree_constant_SELECT_SINGLE>` mode, the focused column is the selected column. In :ref:`SELECT_ROW<class_Tree_constant_SELECT_ROW>` mode, the focused column is always 0 if any item is selected. In :ref:`SELECT_MULTI<class_Tree_constant_SELECT_MULTI>` mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected.

To tell whether a column of an item is selected, use :ref:`TreeItem.is_selected<class_TreeItem_method_is_selected>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` is_column_clipping_content(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_is_column_clipping_content>`

Returns true if the column has enabled clipping (see :ref:`set_column_clip_content<class_Tree_method_set_column_clip_content>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

:ref:`bool<class_bool>` is_column_expanding(column: :ref:`int<class_int>`) |const| :ref:`πŸ”—<class_Tree_method_is_column_expanding>`

Returns true if the column has enabled expanding (see :ref:`set_column_expand<class_Tree_method_set_column_expand>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| scroll_to_item(item: :ref:`TreeItem<class_TreeItem>`, center_on_item: :ref:`bool<class_bool>` = false) :ref:`πŸ”—<class_Tree_method_scroll_to_item>`

Causes the Tree to jump to the specified :ref:`TreeItem<class_TreeItem>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_clip_content(column: :ref:`int<class_int>`, enable: :ref:`bool<class_bool>`) :ref:`πŸ”—<class_Tree_method_set_column_clip_content>`

Allows to enable clipping for column's content, making the content size ignored.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_custom_minimum_width(column: :ref:`int<class_int>`, min_width: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_method_set_column_custom_minimum_width>`

Overrides the calculated minimum width of a column. It can be set to 0 to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_expand(column: :ref:`int<class_int>`, expand: :ref:`bool<class_bool>`) :ref:`πŸ”—<class_Tree_method_set_column_expand>`

If true, the column will have the "Expand" flag of :ref:`Control<class_Control>`. Columns that have the "Expand" flag will use their expand ratio in a similar fashion to :ref:`Control.size_flags_stretch_ratio<class_Control_property_size_flags_stretch_ratio>` (see :ref:`set_column_expand_ratio<class_Tree_method_set_column_expand_ratio>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_expand_ratio(column: :ref:`int<class_int>`, ratio: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_method_set_column_expand_ratio>`

Sets the relative expand ratio for a column. See :ref:`set_column_expand<class_Tree_method_set_column_expand>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_title(column: :ref:`int<class_int>`, title: :ref:`String<class_String>`) :ref:`πŸ”—<class_Tree_method_set_column_title>`

Sets the title of a column.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_title_alignment(column: :ref:`int<class_int>`, title_alignment: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>`) :ref:`πŸ”—<class_Tree_method_set_column_title_alignment>`

Sets the column title alignment. Note that :ref:`@GlobalScope.HORIZONTAL_ALIGNMENT_FILL<class_@GlobalScope_constant_HORIZONTAL_ALIGNMENT_FILL>` is not supported for column titles.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_title_direction(column: :ref:`int<class_int>`, direction: :ref:`TextDirection<enum_Control_TextDirection>`) :ref:`πŸ”—<class_Tree_method_set_column_title_direction>`

Sets column title base writing direction.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_column_title_language(column: :ref:`int<class_int>`, language: :ref:`String<class_String>`) :ref:`πŸ”—<class_Tree_method_set_column_title_language>`

Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.

.. rst-class:: classref-item-separator


.. rst-class:: classref-method

|void| set_selected(item: :ref:`TreeItem<class_TreeItem>`, column: :ref:`int<class_int>`) :ref:`πŸ”—<class_Tree_method_set_selected>`

Selects the specified :ref:`TreeItem<class_TreeItem>` and column.

.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Theme Property Descriptions

.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` children_hl_line_color = Color(0.27, 0.27, 0.27, 1) :ref:`πŸ”—<class_Tree_theme_color_children_hl_line_color>`

The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` custom_button_font_highlight = Color(0.95, 0.95, 0.95, 1) :ref:`πŸ”—<class_Tree_theme_color_custom_button_font_highlight>`

Text :ref:`Color<class_Color>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when it's hovered.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` drop_position_color = Color(1, 1, 1, 1) :ref:`πŸ”—<class_Tree_theme_color_drop_position_color>`

:ref:`Color<class_Color>` used to draw possible drop locations. See :ref:`DropModeFlags<enum_Tree_DropModeFlags>` constants for further description of drop locations.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` font_color = Color(0.7, 0.7, 0.7, 1) :ref:`πŸ”—<class_Tree_theme_color_font_color>`

Default text :ref:`Color<class_Color>` of the item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` font_disabled_color = Color(0.875, 0.875, 0.875, 0.5) :ref:`πŸ”—<class_Tree_theme_color_font_disabled_color>`

Text :ref:`Color<class_Color>` for a :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell when it's non-editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` font_outline_color = Color(0, 0, 0, 1) :ref:`πŸ”—<class_Tree_theme_color_font_outline_color>`

The tint of text outline of the item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` font_selected_color = Color(1, 1, 1, 1) :ref:`πŸ”—<class_Tree_theme_color_font_selected_color>`

Text :ref:`Color<class_Color>` used when the item is selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` guide_color = Color(0.7, 0.7, 0.7, 0.25) :ref:`πŸ”—<class_Tree_theme_color_guide_color>`

:ref:`Color<class_Color>` of the guideline.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` parent_hl_line_color = Color(0.27, 0.27, 0.27, 1) :ref:`πŸ”—<class_Tree_theme_color_parent_hl_line_color>`

The :ref:`Color<class_Color>` of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` relationship_line_color = Color(0.27, 0.27, 0.27, 1) :ref:`πŸ”—<class_Tree_theme_color_relationship_line_color>`

The default :ref:`Color<class_Color>` of the relationship lines.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Color<class_Color>` title_button_color = Color(0.875, 0.875, 0.875, 1) :ref:`πŸ”—<class_Tree_theme_color_title_button_color>`

Default text :ref:`Color<class_Color>` of the title button.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` button_margin = 4 :ref:`πŸ”—<class_Tree_theme_constant_button_margin>`

The horizontal space between each button in a cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` children_hl_line_width = 1 :ref:`πŸ”—<class_Tree_theme_constant_children_hl_line_width>`

The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its children.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` draw_guides = 1 :ref:`πŸ”—<class_Tree_theme_constant_draw_guides>`

Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` draw_relationship_lines = 0 :ref:`πŸ”—<class_Tree_theme_constant_draw_relationship_lines>`

Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` h_separation = 4 :ref:`πŸ”—<class_Tree_theme_constant_h_separation>`

The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` icon_max_width = 0 :ref:`πŸ”—<class_Tree_theme_constant_icon_max_width>`

The maximum allowed width of the icon in item's cells. This limit is applied on top of the default size of the icon, but before the value set with :ref:`TreeItem.set_icon_max_width<class_TreeItem_method_set_icon_max_width>`. The height is adjusted according to the icon's ratio.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` inner_item_margin_bottom = 0 :ref:`πŸ”—<class_Tree_theme_constant_inner_item_margin_bottom>`

The inner bottom margin of a cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` inner_item_margin_left = 0 :ref:`πŸ”—<class_Tree_theme_constant_inner_item_margin_left>`

The inner left margin of a cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` inner_item_margin_right = 0 :ref:`πŸ”—<class_Tree_theme_constant_inner_item_margin_right>`

The inner right margin of a cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` inner_item_margin_top = 0 :ref:`πŸ”—<class_Tree_theme_constant_inner_item_margin_top>`

The inner top margin of a cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` item_margin = 16 :ref:`πŸ”—<class_Tree_theme_constant_item_margin>`

The horizontal margin at the start of an item. This is used when folding is enabled for the item.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` outline_size = 0 :ref:`πŸ”—<class_Tree_theme_constant_outline_size>`

The size of the text outline.

Note: If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least twice the value of :ref:`outline_size<class_Tree_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` parent_hl_line_margin = 0 :ref:`πŸ”—<class_Tree_theme_constant_parent_hl_line_margin>`

The space between the parent relationship lines for the selected :ref:`TreeItem<class_TreeItem>` and the relationship lines to its siblings that are not selected.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` parent_hl_line_width = 1 :ref:`πŸ”—<class_Tree_theme_constant_parent_hl_line_width>`

The width of the relationship lines between the selected :ref:`TreeItem<class_TreeItem>` and its parents.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` relationship_line_width = 1 :ref:`πŸ”—<class_Tree_theme_constant_relationship_line_width>`

The default width of the relationship lines.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scroll_border = 4 :ref:`πŸ”—<class_Tree_theme_constant_scroll_border>`

The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scroll_speed = 12 :ref:`πŸ”—<class_Tree_theme_constant_scroll_speed>`

The speed of border scrolling.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_h_separation = 4 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_h_separation>`

The horizontal separation of tree content and scrollbar.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_margin_bottom = -1 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_margin_bottom>`

The bottom margin of the scrollbars. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` bottom margin.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_margin_left = -1 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_margin_left>`

The left margin of the horizontal scrollbar. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` left margin.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_margin_right = -1 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_margin_right>`

The right margin of the scrollbars. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` right margin.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_margin_top = -1 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_margin_top>`

The top margin of the vertical scrollbar. When negative, uses :ref:`panel<class_Tree_theme_style_panel>` top margin.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` scrollbar_v_separation = 4 :ref:`πŸ”—<class_Tree_theme_constant_scrollbar_v_separation>`

The vertical separation of tree content and scrollbar.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` v_separation = 4 :ref:`πŸ”—<class_Tree_theme_constant_v_separation>`

The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Font<class_Font>` font :ref:`πŸ”—<class_Tree_theme_font_font>`

:ref:`Font<class_Font>` of the item's text.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Font<class_Font>` title_button_font :ref:`πŸ”—<class_Tree_theme_font_title_button_font>`

:ref:`Font<class_Font>` of the title button's text.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` font_size :ref:`πŸ”—<class_Tree_theme_font_size_font_size>`

Font size of the item's text.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`int<class_int>` title_button_font_size :ref:`πŸ”—<class_Tree_theme_font_size_title_button_font_size>`

Font size of the title button's text.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` arrow :ref:`πŸ”—<class_Tree_theme_icon_arrow>`

The arrow icon used when a foldable item is not collapsed.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` arrow_collapsed :ref:`πŸ”—<class_Tree_theme_icon_arrow_collapsed>`

The arrow icon used when a foldable item is collapsed (for left-to-right layouts).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` arrow_collapsed_mirrored :ref:`πŸ”—<class_Tree_theme_icon_arrow_collapsed_mirrored>`

The arrow icon used when a foldable item is collapsed (for right-to-left layouts).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` checked :ref:`πŸ”—<class_Tree_theme_icon_checked>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is checked and editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` checked_disabled :ref:`πŸ”—<class_Tree_theme_icon_checked_disabled>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is checked and non-editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` indeterminate :ref:`πŸ”—<class_Tree_theme_icon_indeterminate>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is indeterminate and editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` indeterminate_disabled :ref:`πŸ”—<class_Tree_theme_icon_indeterminate_disabled>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is indeterminate and non-editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` select_arrow :ref:`πŸ”—<class_Tree_theme_icon_select_arrow>`

The arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` unchecked :ref:`πŸ”—<class_Tree_theme_icon_unchecked>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is unchecked and editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` unchecked_disabled :ref:`πŸ”—<class_Tree_theme_icon_unchecked_disabled>`

The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK<class_TreeItem_constant_CELL_MODE_CHECK>` mode cell is unchecked and non-editable (see :ref:`TreeItem.set_editable<class_TreeItem_method_set_editable>`).

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`Texture2D<class_Texture2D>` updown :ref:`πŸ”—<class_Tree_theme_icon_updown>`

The updown arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode cell.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` button_pressed :ref:`πŸ”—<class_Tree_theme_style_button_pressed>`

:ref:`StyleBox<class_StyleBox>` used when a button in the tree is pressed.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` cursor :ref:`πŸ”—<class_Tree_theme_style_cursor>`

:ref:`StyleBox<class_StyleBox>` used for the cursor, when the Tree is being focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` cursor_unfocused :ref:`πŸ”—<class_Tree_theme_style_cursor_unfocused>`

:ref:`StyleBox<class_StyleBox>` used for the cursor, when the Tree is not being focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` custom_button :ref:`πŸ”—<class_Tree_theme_style_custom_button>`

Default :ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode cell when button is enabled with :ref:`TreeItem.set_custom_as_button<class_TreeItem_method_set_custom_as_button>`.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` custom_button_hover :ref:`πŸ”—<class_Tree_theme_style_custom_button_hover>`

:ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode button cell when it's hovered.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` custom_button_pressed :ref:`πŸ”—<class_Tree_theme_style_custom_button_pressed>`

:ref:`StyleBox<class_StyleBox>` for a :ref:`TreeItem.CELL_MODE_CUSTOM<class_TreeItem_constant_CELL_MODE_CUSTOM>` mode button cell when it's pressed.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` focus :ref:`πŸ”—<class_Tree_theme_style_focus>`

The focused style for the Tree, drawn on top of everything.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` panel :ref:`πŸ”—<class_Tree_theme_style_panel>`

The background style for the Tree.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` selected :ref:`πŸ”—<class_Tree_theme_style_selected>`

:ref:`StyleBox<class_StyleBox>` for the selected items, used when the Tree is not being focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` selected_focus :ref:`πŸ”—<class_Tree_theme_style_selected_focus>`

:ref:`StyleBox<class_StyleBox>` for the selected items, used when the Tree is being focused.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` title_button_hover :ref:`πŸ”—<class_Tree_theme_style_title_button_hover>`

:ref:`StyleBox<class_StyleBox>` used when the title button is being hovered.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` title_button_normal :ref:`πŸ”—<class_Tree_theme_style_title_button_normal>`

Default :ref:`StyleBox<class_StyleBox>` for the title button.

.. rst-class:: classref-item-separator


.. rst-class:: classref-themeproperty

:ref:`StyleBox<class_StyleBox>` title_button_pressed :ref:`πŸ”—<class_Tree_theme_style_title_button_pressed>`

:ref:`StyleBox<class_StyleBox>` used when the title button is being pressed.