class_treeitem.rst 78 KB

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