class_treeitem.rst 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TreeItem.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TreeItem:
  6. TreeItem
  7. ========
  8. **Inherits:** :ref:`Object<class_Object>`
  9. Control for a single item inside a :ref:`Tree<class_Tree>`.
  10. Description
  11. -----------
  12. Control for a single item inside a :ref:`Tree<class_Tree>`. May have child ``TreeItem``\ s and be styled as well as contain buttons.
  13. You can remove a ``TreeItem`` by using :ref:`Object.free<class_Object_method_free>`.
  14. Properties
  15. ----------
  16. +-------------------------+-----------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`collapsed<class_TreeItem_property_collapsed>` |
  18. +-------------------------+-----------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`custom_minimum_height<class_TreeItem_property_custom_minimum_height>` |
  20. +-------------------------+-----------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`disable_folding<class_TreeItem_property_disable_folding>` |
  22. +-------------------------+-----------------------------------------------------------------------------+
  23. Methods
  24. -------
  25. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`add_button<class_TreeItem_method_add_button>` **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` button, :ref:`int<class_int>` button_idx=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)** |
  27. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Variant<class_Variant>` | :ref:`call_recursive<class_TreeItem_method_call_recursive>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  29. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
  31. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
  33. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`clear_opentype_features<class_TreeItem_method_clear_opentype_features>` **(** :ref:`int<class_int>` column **)** |
  35. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`TreeItem<class_TreeItem>` | :ref:`create_child<class_TreeItem_method_create_child>` **(** :ref:`int<class_int>` idx=-1 **)** |
  37. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`deselect<class_TreeItem_method_deselect>` **(** :ref:`int<class_int>` column **)** |
  39. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`erase_button<class_TreeItem_method_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |
  41. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_button<class_TreeItem_method_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  43. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>` **(** :ref:`int<class_int>` column **)** |const| |
  45. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`String<class_String>` | :ref:`get_button_tooltip<class_TreeItem_method_get_button_tooltip>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  47. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>` **(** :ref:`int<class_int>` column **)** |const| |
  49. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_child<class_TreeItem_method_get_child>` **(** :ref:`int<class_int>` idx **)** |
  51. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`int<class_int>` | :ref:`get_child_count<class_TreeItem_method_get_child_count>` **(** **)** |
  53. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Array<class_Array>` | :ref:`get_children<class_TreeItem_method_get_children>` **(** **)** |
  55. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Color<class_Color>` | :ref:`get_custom_bg_color<class_TreeItem_method_get_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |const| |
  57. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>` **(** :ref:`int<class_int>` column **)** |const| |
  59. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Font<class_Font>` | :ref:`get_custom_font<class_TreeItem_method_get_custom_font>` **(** :ref:`int<class_int>` column **)** |const| |
  61. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_custom_font_size<class_TreeItem_method_get_custom_font_size>` **(** :ref:`int<class_int>` column **)** |const| |
  63. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>` **(** :ref:`int<class_int>` column **)** |const| |
  65. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_first_child<class_TreeItem_method_get_first_child>` **(** **)** |const| |
  67. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_TreeItem_method_get_icon>` **(** :ref:`int<class_int>` column **)** |const| |
  69. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** |const| |
  71. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>` **(** :ref:`int<class_int>` column **)** |const| |
  73. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>` **(** :ref:`int<class_int>` column **)** |const| |
  75. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`int<class_int>` | :ref:`get_index<class_TreeItem_method_get_index>` **(** **)** |
  77. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`String<class_String>` | :ref:`get_language<class_TreeItem_method_get_language>` **(** :ref:`int<class_int>` column **)** |const| |
  79. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>` **(** :ref:`int<class_int>` column **)** |const| |
  81. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>` **(** **)** |const| |
  83. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  85. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`int<class_int>` | :ref:`get_opentype_feature<class_TreeItem_method_get_opentype_feature>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag **)** |const| |
  87. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>` **(** **)** |const| |
  89. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>` **(** **)** |
  91. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  93. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>` **(** :ref:`int<class_int>` column **)** |const| |
  95. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>` **(** :ref:`int<class_int>` column **)** |
  97. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` | :ref:`get_structured_text_bidi_override<class_TreeItem_method_get_structured_text_bidi_override>` **(** :ref:`int<class_int>` column **)** |const| |
  99. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Array<class_Array>` | :ref:`get_structured_text_bidi_override_options<class_TreeItem_method_get_structured_text_bidi_override_options>` **(** :ref:`int<class_int>` column **)** |const| |
  101. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>` **(** :ref:`int<class_int>` column **)** |const| |
  103. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>` **(** :ref:`int<class_int>` column **)** |const| |
  105. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`TextAlign<enum_TreeItem_TextAlign>` | :ref:`get_text_align<class_TreeItem_method_get_text_align>` **(** :ref:`int<class_int>` column **)** |const| |
  107. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_text_direction<class_TreeItem_method_get_text_direction>` **(** :ref:`int<class_int>` column **)** |const| |
  109. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`String<class_String>` | :ref:`get_tooltip<class_TreeItem_method_get_tooltip>` **(** :ref:`int<class_int>` column **)** |const| |
  111. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Tree<class_Tree>` | :ref:`get_tree<class_TreeItem_method_get_tree>` **(** **)** |const| |
  113. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  115. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>` **(** :ref:`int<class_int>` column **)** |const| |
  117. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** |const| |
  119. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>` **(** :ref:`int<class_int>` column **)** |
  121. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`bool<class_bool>` | :ref:`is_indeterminate<class_TreeItem_method_is_indeterminate>` **(** :ref:`int<class_int>` column **)** |const| |
  123. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>` **(** :ref:`int<class_int>` column **)** |const| |
  125. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>` **(** :ref:`int<class_int>` column **)** |
  127. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | void | :ref:`move_after<class_TreeItem_method_move_after>` **(** :ref:`Object<class_Object>` item **)** |
  129. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | void | :ref:`move_before<class_TreeItem_method_move_before>` **(** :ref:`Object<class_Object>` item **)** |
  131. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`remove_child<class_TreeItem_method_remove_child>` **(** :ref:`Object<class_Object>` child **)** |
  133. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`select<class_TreeItem_method_select>` **(** :ref:`int<class_int>` column **)** |
  135. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`set_button<class_TreeItem_method_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture2D<class_Texture2D>` button **)** |
  137. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)** |
  139. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)** |
  141. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`set_checked<class_TreeItem_method_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
  143. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  145. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`set_custom_bg_color<class_TreeItem_method_set_custom_bg_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)** |
  147. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)** |
  149. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`set_custom_draw<class_TreeItem_method_set_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` callback **)** |
  151. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`set_custom_font<class_TreeItem_method_set_custom_font>` **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)** |
  153. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`set_custom_font_size<class_TreeItem_method_set_custom_font_size>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)** |
  155. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`set_editable<class_TreeItem_method_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
  157. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  159. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`set_icon<class_TreeItem_method_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)** |
  161. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
  163. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)** |
  165. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)** |
  167. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_indeterminate<class_TreeItem_method_set_indeterminate>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)** |
  169. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_language<class_TreeItem_method_set_language>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)** |
  171. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`set_metadata<class_TreeItem_method_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)** |
  173. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`set_opentype_feature<class_TreeItem_method_set_opentype_feature>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)** |
  175. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`set_range<class_TreeItem_method_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
  177. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`set_range_config<class_TreeItem_method_set_range_config>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)** |
  179. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | void | :ref:`set_selectable<class_TreeItem_method_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
  181. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`set_structured_text_bidi_override<class_TreeItem_method_set_structured_text_bidi_override>` **(** :ref:`int<class_int>` column, :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` parser **)** |
  183. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. | void | :ref:`set_structured_text_bidi_override_options<class_TreeItem_method_set_structured_text_bidi_override_options>` **(** :ref:`int<class_int>` column, :ref:`Array<class_Array>` args **)** |
  185. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  186. | void | :ref:`set_suffix<class_TreeItem_method_set_suffix>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  187. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  188. | void | :ref:`set_text<class_TreeItem_method_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  189. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  190. | void | :ref:`set_text_align<class_TreeItem_method_set_text_align>` **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)** |
  191. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  192. | void | :ref:`set_text_direction<class_TreeItem_method_set_text_direction>` **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)** |
  193. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  194. | void | :ref:`set_tooltip<class_TreeItem_method_set_tooltip>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)** |
  195. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  196. | void | :ref:`uncollapse_tree<class_TreeItem_method_uncollapse_tree>` **(** **)** |
  197. +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  198. Enumerations
  199. ------------
  200. .. _enum_TreeItem_TreeCellMode:
  201. .. _class_TreeItem_constant_CELL_MODE_STRING:
  202. .. _class_TreeItem_constant_CELL_MODE_CHECK:
  203. .. _class_TreeItem_constant_CELL_MODE_RANGE:
  204. .. _class_TreeItem_constant_CELL_MODE_ICON:
  205. .. _class_TreeItem_constant_CELL_MODE_CUSTOM:
  206. enum **TreeCellMode**:
  207. - **CELL_MODE_STRING** = **0** --- Cell contains a string.
  208. - **CELL_MODE_CHECK** = **1** --- Cell contains a checkbox.
  209. - **CELL_MODE_RANGE** = **2** --- Cell contains a range.
  210. - **CELL_MODE_ICON** = **3** --- Cell contains an icon.
  211. - **CELL_MODE_CUSTOM** = **4**
  212. ----
  213. .. _enum_TreeItem_TextAlign:
  214. .. _class_TreeItem_constant_ALIGN_LEFT:
  215. .. _class_TreeItem_constant_ALIGN_CENTER:
  216. .. _class_TreeItem_constant_ALIGN_RIGHT:
  217. enum **TextAlign**:
  218. - **ALIGN_LEFT** = **0** --- Align text to the left. See ``set_text_align()``.
  219. - **ALIGN_CENTER** = **1** --- Center text. See ``set_text_align()``.
  220. - **ALIGN_RIGHT** = **2** --- Align text to the right. See ``set_text_align()``.
  221. Property Descriptions
  222. ---------------------
  223. .. _class_TreeItem_property_collapsed:
  224. - :ref:`bool<class_bool>` **collapsed**
  225. +----------+----------------------+
  226. | *Setter* | set_collapsed(value) |
  227. +----------+----------------------+
  228. | *Getter* | is_collapsed() |
  229. +----------+----------------------+
  230. If ``true``, the TreeItem is collapsed.
  231. ----
  232. .. _class_TreeItem_property_custom_minimum_height:
  233. - :ref:`int<class_int>` **custom_minimum_height**
  234. +----------+----------------------------------+
  235. | *Setter* | set_custom_minimum_height(value) |
  236. +----------+----------------------------------+
  237. | *Getter* | get_custom_minimum_height() |
  238. +----------+----------------------------------+
  239. The custom minimum height.
  240. ----
  241. .. _class_TreeItem_property_disable_folding:
  242. - :ref:`bool<class_bool>` **disable_folding**
  243. +----------+----------------------------+
  244. | *Setter* | set_disable_folding(value) |
  245. +----------+----------------------------+
  246. | *Getter* | is_folding_disabled() |
  247. +----------+----------------------------+
  248. If ``true``, folding is disabled for this TreeItem.
  249. Method Descriptions
  250. -------------------
  251. .. _class_TreeItem_method_add_button:
  252. - void **add_button** **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` button, :ref:`int<class_int>` button_idx=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)**
  253. Adds a button with :ref:`Texture2D<class_Texture2D>` ``button`` at column ``column``. The ``button_idx`` index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count<class_TreeItem_method_get_button_count>` immediately after this method. Optionally, the button can be ``disabled`` and have a ``tooltip``.
  254. ----
  255. .. _class_TreeItem_method_call_recursive:
  256. - :ref:`Variant<class_Variant>` **call_recursive** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  257. Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
  258. ----
  259. .. _class_TreeItem_method_clear_custom_bg_color:
  260. - void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
  261. Resets the background color for the given column to default.
  262. ----
  263. .. _class_TreeItem_method_clear_custom_color:
  264. - void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
  265. Resets the color for the given column to default.
  266. ----
  267. .. _class_TreeItem_method_clear_opentype_features:
  268. - void **clear_opentype_features** **(** :ref:`int<class_int>` column **)**
  269. Removes all OpenType features.
  270. ----
  271. .. _class_TreeItem_method_create_child:
  272. - :ref:`TreeItem<class_TreeItem>` **create_child** **(** :ref:`int<class_int>` idx=-1 **)**
  273. Creates an item and adds it as a child.
  274. 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.
  275. ----
  276. .. _class_TreeItem_method_deselect:
  277. - void **deselect** **(** :ref:`int<class_int>` column **)**
  278. Deselects the given column.
  279. ----
  280. .. _class_TreeItem_method_erase_button:
  281. - void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)**
  282. Removes the button at index ``button_idx`` in column ``column``.
  283. ----
  284. .. _class_TreeItem_method_get_button:
  285. - :ref:`Texture2D<class_Texture2D>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  286. Returns the :ref:`Texture2D<class_Texture2D>` of the button at index ``button_idx`` in column ``column``.
  287. ----
  288. .. _class_TreeItem_method_get_button_count:
  289. - :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** |const|
  290. Returns the number of buttons in column ``column``. May be used to get the most recently added button's index, if no index was specified.
  291. ----
  292. .. _class_TreeItem_method_get_button_tooltip:
  293. - :ref:`String<class_String>` **get_button_tooltip** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  294. Returns the tooltip string for the button at index ``button_idx`` in column ``column``.
  295. ----
  296. .. _class_TreeItem_method_get_cell_mode:
  297. - :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** |const|
  298. Returns the column's cell mode.
  299. ----
  300. .. _class_TreeItem_method_get_child:
  301. - :ref:`TreeItem<class_TreeItem>` **get_child** **(** :ref:`int<class_int>` idx **)**
  302. Returns a child item by its index (see :ref:`get_child_count<class_TreeItem_method_get_child_count>`). This method is often used for iterating all children of an item.
  303. Negative indices access the children from the last one.
  304. ----
  305. .. _class_TreeItem_method_get_child_count:
  306. - :ref:`int<class_int>` **get_child_count** **(** **)**
  307. Returns the number of child items.
  308. ----
  309. .. _class_TreeItem_method_get_children:
  310. - :ref:`Array<class_Array>` **get_children** **(** **)**
  311. Returns an array of references to the item's children.
  312. ----
  313. .. _class_TreeItem_method_get_custom_bg_color:
  314. - :ref:`Color<class_Color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** |const|
  315. Returns the custom background color of column ``column``.
  316. ----
  317. .. _class_TreeItem_method_get_custom_color:
  318. - :ref:`Color<class_Color>` **get_custom_color** **(** :ref:`int<class_int>` column **)** |const|
  319. Returns the custom color of column ``column``.
  320. ----
  321. .. _class_TreeItem_method_get_custom_font:
  322. - :ref:`Font<class_Font>` **get_custom_font** **(** :ref:`int<class_int>` column **)** |const|
  323. Returns custom font used to draw text in the column ``column``.
  324. ----
  325. .. _class_TreeItem_method_get_custom_font_size:
  326. - :ref:`int<class_int>` **get_custom_font_size** **(** :ref:`int<class_int>` column **)** |const|
  327. Returns custom font size used to draw text in the column ``column``.
  328. ----
  329. .. _class_TreeItem_method_get_expand_right:
  330. - :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** |const|
  331. Returns ``true`` if ``expand_right`` is set.
  332. ----
  333. .. _class_TreeItem_method_get_first_child:
  334. - :ref:`TreeItem<class_TreeItem>` **get_first_child** **(** **)** |const|
  335. Returns the TreeItem's first child.
  336. ----
  337. .. _class_TreeItem_method_get_icon:
  338. - :ref:`Texture2D<class_Texture2D>` **get_icon** **(** :ref:`int<class_int>` column **)** |const|
  339. Returns the given column's icon :ref:`Texture2D<class_Texture2D>`. Error if no icon is set.
  340. ----
  341. .. _class_TreeItem_method_get_icon_max_width:
  342. - :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** |const|
  343. Returns the column's icon's maximum width.
  344. ----
  345. .. _class_TreeItem_method_get_icon_modulate:
  346. - :ref:`Color<class_Color>` **get_icon_modulate** **(** :ref:`int<class_int>` column **)** |const|
  347. Returns the :ref:`Color<class_Color>` modulating the column's icon.
  348. ----
  349. .. _class_TreeItem_method_get_icon_region:
  350. - :ref:`Rect2<class_Rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** |const|
  351. Returns the icon :ref:`Texture2D<class_Texture2D>` region as :ref:`Rect2<class_Rect2>`.
  352. ----
  353. .. _class_TreeItem_method_get_index:
  354. - :ref:`int<class_int>` **get_index** **(** **)**
  355. Returns the node's order in the tree. For example, if called on the first child item the position is ``0``.
  356. ----
  357. .. _class_TreeItem_method_get_language:
  358. - :ref:`String<class_String>` **get_language** **(** :ref:`int<class_int>` column **)** |const|
  359. Returns item's text language code.
  360. ----
  361. .. _class_TreeItem_method_get_metadata:
  362. - :ref:`Variant<class_Variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** |const|
  363. Returns the metadata value that was set for the given column using :ref:`set_metadata<class_TreeItem_method_set_metadata>`.
  364. ----
  365. .. _class_TreeItem_method_get_next:
  366. - :ref:`TreeItem<class_TreeItem>` **get_next** **(** **)** |const|
  367. Returns the next TreeItem in the tree or a null object if there is none.
  368. ----
  369. .. _class_TreeItem_method_get_next_visible:
  370. - :ref:`TreeItem<class_TreeItem>` **get_next_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  371. Returns the next visible TreeItem in the tree or a null object if there is none.
  372. 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``.
  373. ----
  374. .. _class_TreeItem_method_get_opentype_feature:
  375. - :ref:`int<class_int>` **get_opentype_feature** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag **)** |const|
  376. Returns OpenType feature ``tag`` of the item's text.
  377. ----
  378. .. _class_TreeItem_method_get_parent:
  379. - :ref:`TreeItem<class_TreeItem>` **get_parent** **(** **)** |const|
  380. Returns the parent TreeItem or a null object if there is none.
  381. ----
  382. .. _class_TreeItem_method_get_prev:
  383. - :ref:`TreeItem<class_TreeItem>` **get_prev** **(** **)**
  384. Returns the previous TreeItem in the tree or a null object if there is none.
  385. ----
  386. .. _class_TreeItem_method_get_prev_visible:
  387. - :ref:`TreeItem<class_TreeItem>` **get_prev_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  388. Returns the previous visible TreeItem in the tree or a null object if there is none.
  389. 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``.
  390. ----
  391. .. _class_TreeItem_method_get_range:
  392. - :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** |const|
  393. Returns the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  394. ----
  395. .. _class_TreeItem_method_get_range_config:
  396. - :ref:`Dictionary<class_Dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
  397. Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
  398. ----
  399. .. _class_TreeItem_method_get_structured_text_bidi_override:
  400. - :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` **get_structured_text_bidi_override** **(** :ref:`int<class_int>` column **)** |const|
  401. ----
  402. .. _class_TreeItem_method_get_structured_text_bidi_override_options:
  403. - :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column **)** |const|
  404. ----
  405. .. _class_TreeItem_method_get_suffix:
  406. - :ref:`String<class_String>` **get_suffix** **(** :ref:`int<class_int>` column **)** |const|
  407. Gets the suffix string shown after the column value.
  408. ----
  409. .. _class_TreeItem_method_get_text:
  410. - :ref:`String<class_String>` **get_text** **(** :ref:`int<class_int>` column **)** |const|
  411. Returns the given column's text.
  412. ----
  413. .. _class_TreeItem_method_get_text_align:
  414. - :ref:`TextAlign<enum_TreeItem_TextAlign>` **get_text_align** **(** :ref:`int<class_int>` column **)** |const|
  415. Returns the given column's text alignment.
  416. ----
  417. .. _class_TreeItem_method_get_text_direction:
  418. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** :ref:`int<class_int>` column **)** |const|
  419. Returns item's text base writing direction.
  420. ----
  421. .. _class_TreeItem_method_get_tooltip:
  422. - :ref:`String<class_String>` **get_tooltip** **(** :ref:`int<class_int>` column **)** |const|
  423. Returns the given column's tooltip.
  424. ----
  425. .. _class_TreeItem_method_get_tree:
  426. - :ref:`Tree<class_Tree>` **get_tree** **(** **)** |const|
  427. Returns the :ref:`Tree<class_Tree>` that owns this TreeItem.
  428. ----
  429. .. _class_TreeItem_method_is_button_disabled:
  430. - :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  431. Returns ``true`` if the button at index ``button_idx`` for the given column is disabled.
  432. ----
  433. .. _class_TreeItem_method_is_checked:
  434. - :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** |const|
  435. Returns ``true`` if the given column is checked.
  436. ----
  437. .. _class_TreeItem_method_is_custom_set_as_button:
  438. - :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** |const|
  439. ----
  440. .. _class_TreeItem_method_is_editable:
  441. - :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
  442. Returns ``true`` if column ``column`` is editable.
  443. ----
  444. .. _class_TreeItem_method_is_indeterminate:
  445. - :ref:`bool<class_bool>` **is_indeterminate** **(** :ref:`int<class_int>` column **)** |const|
  446. Returns ``true`` if the given column is indeterminate.
  447. ----
  448. .. _class_TreeItem_method_is_selectable:
  449. - :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** |const|
  450. Returns ``true`` if column ``column`` is selectable.
  451. ----
  452. .. _class_TreeItem_method_is_selected:
  453. - :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
  454. Returns ``true`` if column ``column`` is selected.
  455. ----
  456. .. _class_TreeItem_method_move_after:
  457. - void **move_after** **(** :ref:`Object<class_Object>` item **)**
  458. Moves this TreeItem right after the given ``item``.
  459. **Note:** You can't move to the root or move the root.
  460. ----
  461. .. _class_TreeItem_method_move_before:
  462. - void **move_before** **(** :ref:`Object<class_Object>` item **)**
  463. Moves this TreeItem right before the given ``item``.
  464. **Note:** You can't move to the root or move the root.
  465. ----
  466. .. _class_TreeItem_method_remove_child:
  467. - void **remove_child** **(** :ref:`Object<class_Object>` child **)**
  468. Removes the given child ``TreeItem`` and all its children from the :ref:`Tree<class_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_Object_method_free>`.
  469. ----
  470. .. _class_TreeItem_method_select:
  471. - void **select** **(** :ref:`int<class_int>` column **)**
  472. Selects the column ``column``.
  473. ----
  474. .. _class_TreeItem_method_set_button:
  475. - void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture2D<class_Texture2D>` button **)**
  476. Sets the given column's button :ref:`Texture2D<class_Texture2D>` at index ``button_idx`` to ``button``.
  477. ----
  478. .. _class_TreeItem_method_set_button_disabled:
  479. - void **set_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)**
  480. If ``true``, disables the button at index ``button_idx`` in column ``column``.
  481. ----
  482. .. _class_TreeItem_method_set_cell_mode:
  483. - void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)**
  484. Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` constants.
  485. ----
  486. .. _class_TreeItem_method_set_checked:
  487. - void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
  488. If ``true``, the column ``column`` is checked. Clears column's indeterminate status.
  489. ----
  490. .. _class_TreeItem_method_set_custom_as_button:
  491. - void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  492. ----
  493. .. _class_TreeItem_method_set_custom_bg_color:
  494. - void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)**
  495. Sets the given column's custom background color and whether to just use it as an outline.
  496. ----
  497. .. _class_TreeItem_method_set_custom_color:
  498. - void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)**
  499. Sets the given column's custom color.
  500. ----
  501. .. _class_TreeItem_method_set_custom_draw:
  502. - void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` callback **)**
  503. Sets the given column's custom draw callback to ``callback`` method on ``object``.
  504. The ``callback`` should accept two arguments: the ``TreeItem`` that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
  505. ----
  506. .. _class_TreeItem_method_set_custom_font:
  507. - void **set_custom_font** **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)**
  508. Sets custom font used to draw text in the column ``column``.
  509. ----
  510. .. _class_TreeItem_method_set_custom_font_size:
  511. - void **set_custom_font_size** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)**
  512. Sets custom font size used to draw text in the column ``column``.
  513. ----
  514. .. _class_TreeItem_method_set_editable:
  515. - void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
  516. If ``true``, column ``column`` is editable.
  517. ----
  518. .. _class_TreeItem_method_set_expand_right:
  519. - void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  520. If ``true``, column ``column`` is expanded to the right.
  521. ----
  522. .. _class_TreeItem_method_set_icon:
  523. - void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)**
  524. Sets the given column's icon :ref:`Texture2D<class_Texture2D>`.
  525. ----
  526. .. _class_TreeItem_method_set_icon_max_width:
  527. - void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
  528. Sets the given column's icon's maximum width.
  529. ----
  530. .. _class_TreeItem_method_set_icon_modulate:
  531. - void **set_icon_modulate** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)**
  532. Modulates the given column's icon with ``modulate``.
  533. ----
  534. .. _class_TreeItem_method_set_icon_region:
  535. - void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)**
  536. Sets the given column's icon's texture region.
  537. ----
  538. .. _class_TreeItem_method_set_indeterminate:
  539. - void **set_indeterminate** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)**
  540. If ``true``, the column ``column`` is marked indeterminate.
  541. **Note:** If set ``true`` from ``false``, then column is cleared of checked status.
  542. ----
  543. .. _class_TreeItem_method_set_language:
  544. - void **set_language** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)**
  545. Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  546. ----
  547. .. _class_TreeItem_method_set_metadata:
  548. - void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)**
  549. Sets the metadata value for the given column, which can be retrieved later using :ref:`get_metadata<class_TreeItem_method_get_metadata>`. This can be used, for example, to store a reference to the original data.
  550. ----
  551. .. _class_TreeItem_method_set_opentype_feature:
  552. - void **set_opentype_feature** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tag, :ref:`int<class_int>` value **)**
  553. Sets OpenType feature ``tag`` for the item's text.
  554. ----
  555. .. _class_TreeItem_method_set_range:
  556. - void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
  557. Sets the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  558. ----
  559. .. _class_TreeItem_method_set_range_config:
  560. - void **set_range_config** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` min, :ref:`float<class_float>` max, :ref:`float<class_float>` step, :ref:`bool<class_bool>` expr=false **)**
  561. Sets the range of accepted values for a column. The column must be in the :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` mode.
  562. If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit<class_Range_property_exp_edit>`.
  563. ----
  564. .. _class_TreeItem_method_set_selectable:
  565. - void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
  566. If ``true``, the given column is selectable.
  567. ----
  568. .. _class_TreeItem_method_set_structured_text_bidi_override:
  569. - void **set_structured_text_bidi_override** **(** :ref:`int<class_int>` column, :ref:`StructuredTextParser<enum_Control_StructuredTextParser>` parser **)**
  570. ----
  571. .. _class_TreeItem_method_set_structured_text_bidi_override_options:
  572. - void **set_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column, :ref:`Array<class_Array>` args **)**
  573. ----
  574. .. _class_TreeItem_method_set_suffix:
  575. - void **set_suffix** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  576. Sets a string to be shown after a column's value (for example, a unit abbreviation).
  577. ----
  578. .. _class_TreeItem_method_set_text:
  579. - void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  580. Sets the given column's text value.
  581. ----
  582. .. _class_TreeItem_method_set_text_align:
  583. - void **set_text_align** **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)**
  584. Sets the given column's text alignment. See :ref:`TextAlign<enum_TreeItem_TextAlign>` for possible values.
  585. ----
  586. .. _class_TreeItem_method_set_text_direction:
  587. - void **set_text_direction** **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)**
  588. Sets item's text base writing direction.
  589. ----
  590. .. _class_TreeItem_method_set_tooltip:
  591. - void **set_tooltip** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)**
  592. Sets the given column's tooltip text.
  593. ----
  594. .. _class_TreeItem_method_uncollapse_tree:
  595. - void **uncollapse_tree** **(** **)**
  596. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  597. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  598. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  599. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  600. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  601. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`