class_treeitem.rst 101 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611
  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/4.1/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/TreeItem.xml.
  6. .. _class_TreeItem:
  7. TreeItem
  8. ========
  9. **Inherits:** :ref:`Object<class_Object>`
  10. An internal control for a single item inside :ref:`Tree<class_Tree>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A single item of a :ref:`Tree<class_Tree>` control. It can contain other **TreeItem**\ s as children, which allows it to create a hierarchy. It can also contain text and buttons. **TreeItem** is not a :ref:`Node<class_Node>`, it is internal to the :ref:`Tree<class_Tree>`.
  15. To create a **TreeItem**, use :ref:`Tree.create_item<class_Tree_method_create_item>` or :ref:`create_child<class_TreeItem_method_create_child>`. To remove a **TreeItem**, use :ref:`Object.free<class_Object_method_free>`.
  16. \ **Note:** The ID values used for buttons are 32-bit, unlike :ref:`int<class_int>` which is always 64-bit. They go from ``-2147483648`` to ``2147483647``.
  17. .. rst-class:: classref-reftable-group
  18. Properties
  19. ----------
  20. .. table::
  21. :widths: auto
  22. +-------------------------+-----------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`collapsed<class_TreeItem_property_collapsed>` |
  24. +-------------------------+-----------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`custom_minimum_height<class_TreeItem_property_custom_minimum_height>` |
  26. +-------------------------+-----------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`disable_folding<class_TreeItem_property_disable_folding>` |
  28. +-------------------------+-----------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`visible<class_TreeItem_property_visible>` |
  30. +-------------------------+-----------------------------------------------------------------------------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | 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_text="" **)** |
  38. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`add_child<class_TreeItem_method_add_child>` **(** :ref:`TreeItem<class_TreeItem>` child **)** |
  40. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`call_recursive<class_TreeItem_method_call_recursive>` **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg| |
  42. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
  44. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
  46. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`TreeItem<class_TreeItem>` | :ref:`create_child<class_TreeItem_method_create_child>` **(** :ref:`int<class_int>` index=-1 **)** |
  48. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`deselect<class_TreeItem_method_deselect>` **(** :ref:`int<class_int>` column **)** |
  50. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`erase_button<class_TreeItem_method_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |
  52. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` | :ref:`get_autowrap_mode<class_TreeItem_method_get_autowrap_mode>` **(** :ref:`int<class_int>` column **)** |const| |
  54. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_button<class_TreeItem_method_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const| |
  56. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :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| |
  58. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>` **(** :ref:`int<class_int>` column **)** |const| |
  60. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_button_id<class_TreeItem_method_get_button_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const| |
  62. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | :ref:`get_button_tooltip_text<class_TreeItem_method_get_button_tooltip_text>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const| |
  64. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>` **(** :ref:`int<class_int>` column **)** |const| |
  66. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_child<class_TreeItem_method_get_child>` **(** :ref:`int<class_int>` index **)** |
  68. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_child_count<class_TreeItem_method_get_child_count>` **(** **)** |
  70. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`TreeItem[]<class_TreeItem>` | :ref:`get_children<class_TreeItem_method_get_children>` **(** **)** |
  72. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Color<class_Color>` | :ref:`get_custom_bg_color<class_TreeItem_method_get_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |const| |
  74. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>` **(** :ref:`int<class_int>` column **)** |const| |
  76. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`Font<class_Font>` | :ref:`get_custom_font<class_TreeItem_method_get_custom_font>` **(** :ref:`int<class_int>` column **)** |const| |
  78. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`int<class_int>` | :ref:`get_custom_font_size<class_TreeItem_method_get_custom_font_size>` **(** :ref:`int<class_int>` column **)** |const| |
  80. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>` **(** :ref:`int<class_int>` column **)** |const| |
  82. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_first_child<class_TreeItem_method_get_first_child>` **(** **)** |const| |
  84. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_icon<class_TreeItem_method_get_icon>` **(** :ref:`int<class_int>` column **)** |const| |
  86. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** |const| |
  88. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>` **(** :ref:`int<class_int>` column **)** |const| |
  90. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>` **(** :ref:`int<class_int>` column **)** |const| |
  92. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`get_index<class_TreeItem_method_get_index>` **(** **)** |
  94. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`String<class_String>` | :ref:`get_language<class_TreeItem_method_get_language>` **(** :ref:`int<class_int>` column **)** |const| |
  96. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>` **(** :ref:`int<class_int>` column **)** |const| |
  98. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>` **(** **)** |const| |
  100. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_in_tree<class_TreeItem_method_get_next_in_tree>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  102. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  104. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>` **(** **)** |const| |
  106. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>` **(** **)** |
  108. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_in_tree<class_TreeItem_method_get_prev_in_tree>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  110. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  112. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>` **(** :ref:`int<class_int>` column **)** |const| |
  114. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>` **(** :ref:`int<class_int>` column **)** |
  116. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :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| |
  118. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :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| |
  120. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>` **(** :ref:`int<class_int>` column **)** |const| |
  122. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>` **(** :ref:`int<class_int>` column **)** |const| |
  124. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`get_text_alignment<class_TreeItem_method_get_text_alignment>` **(** :ref:`int<class_int>` column **)** |const| |
  126. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_text_direction<class_TreeItem_method_get_text_direction>` **(** :ref:`int<class_int>` column **)** |const| |
  128. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`get_text_overrun_behavior<class_TreeItem_method_get_text_overrun_behavior>` **(** :ref:`int<class_int>` column **)** |const| |
  130. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`String<class_String>` | :ref:`get_tooltip_text<class_TreeItem_method_get_tooltip_text>` **(** :ref:`int<class_int>` column **)** |const| |
  132. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`Tree<class_Tree>` | :ref:`get_tree<class_TreeItem_method_get_tree>` **(** **)** |const| |
  134. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`bool<class_bool>` | :ref:`is_any_collapsed<class_TreeItem_method_is_any_collapsed>` **(** :ref:`bool<class_bool>` only_visible=false **)** |
  136. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const| |
  138. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>` **(** :ref:`int<class_int>` column **)** |const| |
  140. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** |const| |
  142. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`bool<class_bool>` | :ref:`is_edit_multiline<class_TreeItem_method_is_edit_multiline>` **(** :ref:`int<class_int>` column **)** |const| |
  144. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>` **(** :ref:`int<class_int>` column **)** |
  146. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`bool<class_bool>` | :ref:`is_indeterminate<class_TreeItem_method_is_indeterminate>` **(** :ref:`int<class_int>` column **)** |const| |
  148. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>` **(** :ref:`int<class_int>` column **)** |const| |
  150. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>` **(** :ref:`int<class_int>` column **)** |
  152. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`move_after<class_TreeItem_method_move_after>` **(** :ref:`TreeItem<class_TreeItem>` item **)** |
  154. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`move_before<class_TreeItem_method_move_before>` **(** :ref:`TreeItem<class_TreeItem>` item **)** |
  156. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`propagate_check<class_TreeItem_method_propagate_check>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` emit_signal=true **)** |
  158. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`remove_child<class_TreeItem_method_remove_child>` **(** :ref:`TreeItem<class_TreeItem>` child **)** |
  160. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`select<class_TreeItem_method_select>` **(** :ref:`int<class_int>` column **)** |
  162. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`set_autowrap_mode<class_TreeItem_method_set_autowrap_mode>` **(** :ref:`int<class_int>` column, :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` autowrap_mode **)** |
  164. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`set_button<class_TreeItem_method_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`Texture2D<class_Texture2D>` button **)** |
  166. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`set_button_color<class_TreeItem_method_set_button_color>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`Color<class_Color>` color **)** |
  168. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`bool<class_bool>` disabled **)** |
  170. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)** |
  172. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | void | :ref:`set_checked<class_TreeItem_method_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
  174. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`set_collapsed_recursive<class_TreeItem_method_set_collapsed_recursive>` **(** :ref:`bool<class_bool>` enable **)** |
  176. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | void | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  178. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | 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 **)** |
  180. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | void | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)** |
  182. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | 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 **)** |
  184. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | void | :ref:`set_custom_font<class_TreeItem_method_set_custom_font>` **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)** |
  186. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`set_custom_font_size<class_TreeItem_method_set_custom_font_size>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)** |
  188. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | void | :ref:`set_edit_multiline<class_TreeItem_method_set_edit_multiline>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` multiline **)** |
  190. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | void | :ref:`set_editable<class_TreeItem_method_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
  192. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | void | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  194. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | void | :ref:`set_icon<class_TreeItem_method_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)** |
  196. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | void | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
  198. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | void | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)** |
  200. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | void | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)** |
  202. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | void | :ref:`set_indeterminate<class_TreeItem_method_set_indeterminate>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)** |
  204. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | void | :ref:`set_language<class_TreeItem_method_set_language>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)** |
  206. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | void | :ref:`set_metadata<class_TreeItem_method_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)** |
  208. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | void | :ref:`set_range<class_TreeItem_method_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
  210. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | 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 **)** |
  212. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | void | :ref:`set_selectable<class_TreeItem_method_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
  214. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | 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 **)** |
  216. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | 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 **)** |
  218. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | void | :ref:`set_suffix<class_TreeItem_method_set_suffix>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  220. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | void | :ref:`set_text<class_TreeItem_method_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  222. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | void | :ref:`set_text_alignment<class_TreeItem_method_set_text_alignment>` **(** :ref:`int<class_int>` column, :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` text_alignment **)** |
  224. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. | void | :ref:`set_text_direction<class_TreeItem_method_set_text_direction>` **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)** |
  226. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  227. | void | :ref:`set_text_overrun_behavior<class_TreeItem_method_set_text_overrun_behavior>` **(** :ref:`int<class_int>` column, :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` overrun_behavior **)** |
  228. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  229. | void | :ref:`set_tooltip_text<class_TreeItem_method_set_tooltip_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)** |
  230. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  231. | void | :ref:`uncollapse_tree<class_TreeItem_method_uncollapse_tree>` **(** **)** |
  232. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  233. .. rst-class:: classref-section-separator
  234. ----
  235. .. rst-class:: classref-descriptions-group
  236. Enumerations
  237. ------------
  238. .. _enum_TreeItem_TreeCellMode:
  239. .. rst-class:: classref-enumeration
  240. enum **TreeCellMode**:
  241. .. _class_TreeItem_constant_CELL_MODE_STRING:
  242. .. rst-class:: classref-enumeration-constant
  243. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_STRING** = ``0``
  244. Cell contains a string.
  245. .. _class_TreeItem_constant_CELL_MODE_CHECK:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CHECK** = ``1``
  248. Cell contains a checkbox.
  249. .. _class_TreeItem_constant_CELL_MODE_RANGE:
  250. .. rst-class:: classref-enumeration-constant
  251. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_RANGE** = ``2``
  252. Cell contains a range.
  253. .. _class_TreeItem_constant_CELL_MODE_ICON:
  254. .. rst-class:: classref-enumeration-constant
  255. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_ICON** = ``3``
  256. Cell contains an icon.
  257. .. _class_TreeItem_constant_CELL_MODE_CUSTOM:
  258. .. rst-class:: classref-enumeration-constant
  259. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CUSTOM** = ``4``
  260. .. rst-class:: classref-section-separator
  261. ----
  262. .. rst-class:: classref-descriptions-group
  263. Property Descriptions
  264. ---------------------
  265. .. _class_TreeItem_property_collapsed:
  266. .. rst-class:: classref-property
  267. :ref:`bool<class_bool>` **collapsed**
  268. .. rst-class:: classref-property-setget
  269. - void **set_collapsed** **(** :ref:`bool<class_bool>` value **)**
  270. - :ref:`bool<class_bool>` **is_collapsed** **(** **)**
  271. If ``true``, the TreeItem is collapsed.
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_TreeItem_property_custom_minimum_height:
  275. .. rst-class:: classref-property
  276. :ref:`int<class_int>` **custom_minimum_height**
  277. .. rst-class:: classref-property-setget
  278. - void **set_custom_minimum_height** **(** :ref:`int<class_int>` value **)**
  279. - :ref:`int<class_int>` **get_custom_minimum_height** **(** **)**
  280. The custom minimum height.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_TreeItem_property_disable_folding:
  284. .. rst-class:: classref-property
  285. :ref:`bool<class_bool>` **disable_folding**
  286. .. rst-class:: classref-property-setget
  287. - void **set_disable_folding** **(** :ref:`bool<class_bool>` value **)**
  288. - :ref:`bool<class_bool>` **is_folding_disabled** **(** **)**
  289. If ``true``, folding is disabled for this TreeItem.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_TreeItem_property_visible:
  293. .. rst-class:: classref-property
  294. :ref:`bool<class_bool>` **visible**
  295. .. rst-class:: classref-property-setget
  296. - void **set_visible** **(** :ref:`bool<class_bool>` value **)**
  297. - :ref:`bool<class_bool>` **is_visible** **(** **)**
  298. If ``true``, the **TreeItem** is visible (default).
  299. Note that if a **TreeItem** is set to not be visible, none of its children will be visible either.
  300. .. rst-class:: classref-section-separator
  301. ----
  302. .. rst-class:: classref-descriptions-group
  303. Method Descriptions
  304. -------------------
  305. .. _class_TreeItem_method_add_button:
  306. .. rst-class:: classref-method
  307. 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_text="" **)**
  308. Adds a button with :ref:`Texture2D<class_Texture2D>` ``button`` at column ``column``. The ``id`` is used to identify the button in the according :ref:`Tree.button_clicked<class_Tree_signal_button_clicked>` signal and can be different from the buttons index. 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_text``.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_TreeItem_method_add_child:
  312. .. rst-class:: classref-method
  313. void **add_child** **(** :ref:`TreeItem<class_TreeItem>` child **)**
  314. Adds a previously unparented **TreeItem** as a direct child of this one. The ``child`` item must not be a part of any :ref:`Tree<class_Tree>` or parented to any **TreeItem**. See also :ref:`remove_child<class_TreeItem_method_remove_child>`.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_TreeItem_method_call_recursive:
  318. .. rst-class:: classref-method
  319. void **call_recursive** **(** :ref:`StringName<class_StringName>` method, ... **)** |vararg|
  320. Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_TreeItem_method_clear_custom_bg_color:
  324. .. rst-class:: classref-method
  325. void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
  326. Resets the background color for the given column to default.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_TreeItem_method_clear_custom_color:
  330. .. rst-class:: classref-method
  331. void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
  332. Resets the color for the given column to default.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_TreeItem_method_create_child:
  336. .. rst-class:: classref-method
  337. :ref:`TreeItem<class_TreeItem>` **create_child** **(** :ref:`int<class_int>` index=-1 **)**
  338. Creates an item and adds it as a child.
  339. The new item will be inserted as position ``index`` (the default value ``-1`` means the last position), or it will be the last child if ``index`` is higher than the child count.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_TreeItem_method_deselect:
  343. .. rst-class:: classref-method
  344. void **deselect** **(** :ref:`int<class_int>` column **)**
  345. Deselects the given column.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_TreeItem_method_erase_button:
  349. .. rst-class:: classref-method
  350. void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)**
  351. Removes the button at index ``button_index`` in column ``column``.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_TreeItem_method_get_autowrap_mode:
  355. .. rst-class:: classref-method
  356. :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` **get_autowrap_mode** **(** :ref:`int<class_int>` column **)** |const|
  357. Returns the text autowrap mode in the given ``column``. By default it is :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_TreeItem_method_get_button:
  361. .. rst-class:: classref-method
  362. :ref:`Texture2D<class_Texture2D>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const|
  363. Returns the :ref:`Texture2D<class_Texture2D>` of the button at index ``button_index`` in column ``column``.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_TreeItem_method_get_button_by_id:
  367. .. rst-class:: classref-method
  368. :ref:`int<class_int>` **get_button_by_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const|
  369. Returns the button index if there is a button with ID ``id`` in column ``column``, otherwise returns -1.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_TreeItem_method_get_button_count:
  373. .. rst-class:: classref-method
  374. :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** |const|
  375. Returns the number of buttons in column ``column``.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_TreeItem_method_get_button_id:
  379. .. rst-class:: classref-method
  380. :ref:`int<class_int>` **get_button_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const|
  381. Returns the ID for the button at index ``button_index`` in column ``column``.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_TreeItem_method_get_button_tooltip_text:
  385. .. rst-class:: classref-method
  386. :ref:`String<class_String>` **get_button_tooltip_text** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const|
  387. Returns the tooltip text for the button at index ``button_index`` in column ``column``.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_TreeItem_method_get_cell_mode:
  391. .. rst-class:: classref-method
  392. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** |const|
  393. Returns the column's cell mode.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _class_TreeItem_method_get_child:
  397. .. rst-class:: classref-method
  398. :ref:`TreeItem<class_TreeItem>` **get_child** **(** :ref:`int<class_int>` index **)**
  399. 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.
  400. Negative indices access the children from the last one.
  401. .. rst-class:: classref-item-separator
  402. ----
  403. .. _class_TreeItem_method_get_child_count:
  404. .. rst-class:: classref-method
  405. :ref:`int<class_int>` **get_child_count** **(** **)**
  406. Returns the number of child items.
  407. .. rst-class:: classref-item-separator
  408. ----
  409. .. _class_TreeItem_method_get_children:
  410. .. rst-class:: classref-method
  411. :ref:`TreeItem[]<class_TreeItem>` **get_children** **(** **)**
  412. Returns an array of references to the item's children.
  413. .. rst-class:: classref-item-separator
  414. ----
  415. .. _class_TreeItem_method_get_custom_bg_color:
  416. .. rst-class:: classref-method
  417. :ref:`Color<class_Color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** |const|
  418. Returns the custom background color of column ``column``.
  419. .. rst-class:: classref-item-separator
  420. ----
  421. .. _class_TreeItem_method_get_custom_color:
  422. .. rst-class:: classref-method
  423. :ref:`Color<class_Color>` **get_custom_color** **(** :ref:`int<class_int>` column **)** |const|
  424. Returns the custom color of column ``column``.
  425. .. rst-class:: classref-item-separator
  426. ----
  427. .. _class_TreeItem_method_get_custom_font:
  428. .. rst-class:: classref-method
  429. :ref:`Font<class_Font>` **get_custom_font** **(** :ref:`int<class_int>` column **)** |const|
  430. Returns custom font used to draw text in the column ``column``.
  431. .. rst-class:: classref-item-separator
  432. ----
  433. .. _class_TreeItem_method_get_custom_font_size:
  434. .. rst-class:: classref-method
  435. :ref:`int<class_int>` **get_custom_font_size** **(** :ref:`int<class_int>` column **)** |const|
  436. Returns custom font size used to draw text in the column ``column``.
  437. .. rst-class:: classref-item-separator
  438. ----
  439. .. _class_TreeItem_method_get_expand_right:
  440. .. rst-class:: classref-method
  441. :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** |const|
  442. Returns ``true`` if ``expand_right`` is set.
  443. .. rst-class:: classref-item-separator
  444. ----
  445. .. _class_TreeItem_method_get_first_child:
  446. .. rst-class:: classref-method
  447. :ref:`TreeItem<class_TreeItem>` **get_first_child** **(** **)** |const|
  448. Returns the TreeItem's first child.
  449. .. rst-class:: classref-item-separator
  450. ----
  451. .. _class_TreeItem_method_get_icon:
  452. .. rst-class:: classref-method
  453. :ref:`Texture2D<class_Texture2D>` **get_icon** **(** :ref:`int<class_int>` column **)** |const|
  454. Returns the given column's icon :ref:`Texture2D<class_Texture2D>`. Error if no icon is set.
  455. .. rst-class:: classref-item-separator
  456. ----
  457. .. _class_TreeItem_method_get_icon_max_width:
  458. .. rst-class:: classref-method
  459. :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** |const|
  460. Returns the maximum allowed width of the icon in the given ``column``.
  461. .. rst-class:: classref-item-separator
  462. ----
  463. .. _class_TreeItem_method_get_icon_modulate:
  464. .. rst-class:: classref-method
  465. :ref:`Color<class_Color>` **get_icon_modulate** **(** :ref:`int<class_int>` column **)** |const|
  466. Returns the :ref:`Color<class_Color>` modulating the column's icon.
  467. .. rst-class:: classref-item-separator
  468. ----
  469. .. _class_TreeItem_method_get_icon_region:
  470. .. rst-class:: classref-method
  471. :ref:`Rect2<class_Rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** |const|
  472. Returns the icon :ref:`Texture2D<class_Texture2D>` region as :ref:`Rect2<class_Rect2>`.
  473. .. rst-class:: classref-item-separator
  474. ----
  475. .. _class_TreeItem_method_get_index:
  476. .. rst-class:: classref-method
  477. :ref:`int<class_int>` **get_index** **(** **)**
  478. Returns the node's order in the tree. For example, if called on the first child item the position is ``0``.
  479. .. rst-class:: classref-item-separator
  480. ----
  481. .. _class_TreeItem_method_get_language:
  482. .. rst-class:: classref-method
  483. :ref:`String<class_String>` **get_language** **(** :ref:`int<class_int>` column **)** |const|
  484. Returns item's text language code.
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_TreeItem_method_get_metadata:
  488. .. rst-class:: classref-method
  489. :ref:`Variant<class_Variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** |const|
  490. Returns the metadata value that was set for the given column using :ref:`set_metadata<class_TreeItem_method_set_metadata>`.
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _class_TreeItem_method_get_next:
  494. .. rst-class:: classref-method
  495. :ref:`TreeItem<class_TreeItem>` **get_next** **(** **)** |const|
  496. Returns the next sibling TreeItem in the tree or a null object if there is none.
  497. .. rst-class:: classref-item-separator
  498. ----
  499. .. _class_TreeItem_method_get_next_in_tree:
  500. .. rst-class:: classref-method
  501. :ref:`TreeItem<class_TreeItem>` **get_next_in_tree** **(** :ref:`bool<class_bool>` wrap=false **)**
  502. Returns the next TreeItem in the tree (in the context of a depth-first search) or a ``null`` object if there is none.
  503. If ``wrap`` is enabled, the method will wrap around to the first element in the tree when called on the last element, otherwise it returns ``null``.
  504. .. rst-class:: classref-item-separator
  505. ----
  506. .. _class_TreeItem_method_get_next_visible:
  507. .. rst-class:: classref-method
  508. :ref:`TreeItem<class_TreeItem>` **get_next_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  509. Returns the next visible TreeItem in the tree (in the context of a depth-first search) or a ``null`` object if there is none.
  510. 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``.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_TreeItem_method_get_parent:
  514. .. rst-class:: classref-method
  515. :ref:`TreeItem<class_TreeItem>` **get_parent** **(** **)** |const|
  516. Returns the parent TreeItem or a null object if there is none.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_TreeItem_method_get_prev:
  520. .. rst-class:: classref-method
  521. :ref:`TreeItem<class_TreeItem>` **get_prev** **(** **)**
  522. Returns the previous sibling TreeItem in the tree or a null object if there is none.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_TreeItem_method_get_prev_in_tree:
  526. .. rst-class:: classref-method
  527. :ref:`TreeItem<class_TreeItem>` **get_prev_in_tree** **(** :ref:`bool<class_bool>` wrap=false **)**
  528. Returns the previous TreeItem in the tree (in the context of a depth-first search) or a ``null`` object if there is none.
  529. If ``wrap`` is enabled, the method will wrap around to the last element in the tree when called on the first visible element, otherwise it returns ``null``.
  530. .. rst-class:: classref-item-separator
  531. ----
  532. .. _class_TreeItem_method_get_prev_visible:
  533. .. rst-class:: classref-method
  534. :ref:`TreeItem<class_TreeItem>` **get_prev_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  535. Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first search) or a ``null`` object if there is none.
  536. 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``.
  537. .. rst-class:: classref-item-separator
  538. ----
  539. .. _class_TreeItem_method_get_range:
  540. .. rst-class:: classref-method
  541. :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** |const|
  542. Returns the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  543. .. rst-class:: classref-item-separator
  544. ----
  545. .. _class_TreeItem_method_get_range_config:
  546. .. rst-class:: classref-method
  547. :ref:`Dictionary<class_Dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
  548. Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_TreeItem_method_get_structured_text_bidi_override:
  552. .. rst-class:: classref-method
  553. :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` **get_structured_text_bidi_override** **(** :ref:`int<class_int>` column **)** |const|
  554. .. container:: contribute
  555. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  556. .. rst-class:: classref-item-separator
  557. ----
  558. .. _class_TreeItem_method_get_structured_text_bidi_override_options:
  559. .. rst-class:: classref-method
  560. :ref:`Array<class_Array>` **get_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column **)** |const|
  561. .. container:: contribute
  562. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  563. .. rst-class:: classref-item-separator
  564. ----
  565. .. _class_TreeItem_method_get_suffix:
  566. .. rst-class:: classref-method
  567. :ref:`String<class_String>` **get_suffix** **(** :ref:`int<class_int>` column **)** |const|
  568. Gets the suffix string shown after the column value.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_TreeItem_method_get_text:
  572. .. rst-class:: classref-method
  573. :ref:`String<class_String>` **get_text** **(** :ref:`int<class_int>` column **)** |const|
  574. Returns the given column's text.
  575. .. rst-class:: classref-item-separator
  576. ----
  577. .. _class_TreeItem_method_get_text_alignment:
  578. .. rst-class:: classref-method
  579. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_text_alignment** **(** :ref:`int<class_int>` column **)** |const|
  580. Returns the given column's text alignment.
  581. .. rst-class:: classref-item-separator
  582. ----
  583. .. _class_TreeItem_method_get_text_direction:
  584. .. rst-class:: classref-method
  585. :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** :ref:`int<class_int>` column **)** |const|
  586. Returns item's text base writing direction.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_TreeItem_method_get_text_overrun_behavior:
  590. .. rst-class:: classref-method
  591. :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior** **(** :ref:`int<class_int>` column **)** |const|
  592. Returns the clipping behavior when the text exceeds the item's bounding rectangle in the given ``column``. By default it is :ref:`TextServer.OVERRUN_TRIM_ELLIPSIS<class_TextServer_constant_OVERRUN_TRIM_ELLIPSIS>`.
  593. .. rst-class:: classref-item-separator
  594. ----
  595. .. _class_TreeItem_method_get_tooltip_text:
  596. .. rst-class:: classref-method
  597. :ref:`String<class_String>` **get_tooltip_text** **(** :ref:`int<class_int>` column **)** |const|
  598. Returns the given column's tooltip text.
  599. .. rst-class:: classref-item-separator
  600. ----
  601. .. _class_TreeItem_method_get_tree:
  602. .. rst-class:: classref-method
  603. :ref:`Tree<class_Tree>` **get_tree** **(** **)** |const|
  604. Returns the :ref:`Tree<class_Tree>` that owns this TreeItem.
  605. .. rst-class:: classref-item-separator
  606. ----
  607. .. _class_TreeItem_method_is_any_collapsed:
  608. .. rst-class:: classref-method
  609. :ref:`bool<class_bool>` **is_any_collapsed** **(** :ref:`bool<class_bool>` only_visible=false **)**
  610. Returns ``true`` if this **TreeItem**, or any of its descendants, is collapsed.
  611. If ``only_visible`` is ``true`` it ignores non-visible **TreeItem**\ s.
  612. .. rst-class:: classref-item-separator
  613. ----
  614. .. _class_TreeItem_method_is_button_disabled:
  615. .. rst-class:: classref-method
  616. :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index **)** |const|
  617. Returns ``true`` if the button at index ``button_index`` for the given ``column`` is disabled.
  618. .. rst-class:: classref-item-separator
  619. ----
  620. .. _class_TreeItem_method_is_checked:
  621. .. rst-class:: classref-method
  622. :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** |const|
  623. Returns ``true`` if the given ``column`` is checked.
  624. .. rst-class:: classref-item-separator
  625. ----
  626. .. _class_TreeItem_method_is_custom_set_as_button:
  627. .. rst-class:: classref-method
  628. :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** |const|
  629. .. container:: contribute
  630. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_TreeItem_method_is_edit_multiline:
  634. .. rst-class:: classref-method
  635. :ref:`bool<class_bool>` **is_edit_multiline** **(** :ref:`int<class_int>` column **)** |const|
  636. Returns ``true`` if the given ``column`` is multiline editable.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_TreeItem_method_is_editable:
  640. .. rst-class:: classref-method
  641. :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
  642. Returns ``true`` if the given ``column`` is editable.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_TreeItem_method_is_indeterminate:
  646. .. rst-class:: classref-method
  647. :ref:`bool<class_bool>` **is_indeterminate** **(** :ref:`int<class_int>` column **)** |const|
  648. Returns ``true`` if the given ``column`` is indeterminate.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_TreeItem_method_is_selectable:
  652. .. rst-class:: classref-method
  653. :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** |const|
  654. Returns ``true`` if the given ``column`` is selectable.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_TreeItem_method_is_selected:
  658. .. rst-class:: classref-method
  659. :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
  660. Returns ``true`` if the given ``column`` is selected.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_TreeItem_method_move_after:
  664. .. rst-class:: classref-method
  665. void **move_after** **(** :ref:`TreeItem<class_TreeItem>` item **)**
  666. Moves this TreeItem right after the given ``item``.
  667. \ **Note:** You can't move to the root or move the root.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _class_TreeItem_method_move_before:
  671. .. rst-class:: classref-method
  672. void **move_before** **(** :ref:`TreeItem<class_TreeItem>` item **)**
  673. Moves this TreeItem right before the given ``item``.
  674. \ **Note:** You can't move to the root or move the root.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_TreeItem_method_propagate_check:
  678. .. rst-class:: classref-method
  679. void **propagate_check** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` emit_signal=true **)**
  680. 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.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_TreeItem_method_remove_child:
  684. .. rst-class:: classref-method
  685. void **remove_child** **(** :ref:`TreeItem<class_TreeItem>` child **)**
  686. 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 (see :ref:`add_child<class_TreeItem_method_add_child>`). To completely remove a **TreeItem** use :ref:`Object.free<class_Object_method_free>`.
  687. \ **Note:** If you want to move a child from one :ref:`Tree<class_Tree>` to another, then instead of removing and adding it manually you can use :ref:`move_before<class_TreeItem_method_move_before>` or :ref:`move_after<class_TreeItem_method_move_after>`.
  688. .. rst-class:: classref-item-separator
  689. ----
  690. .. _class_TreeItem_method_select:
  691. .. rst-class:: classref-method
  692. void **select** **(** :ref:`int<class_int>` column **)**
  693. Selects the given ``column``.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _class_TreeItem_method_set_autowrap_mode:
  697. .. rst-class:: classref-method
  698. void **set_autowrap_mode** **(** :ref:`int<class_int>` column, :ref:`AutowrapMode<enum_TextServer_AutowrapMode>` autowrap_mode **)**
  699. Sets the autowrap mode in the given ``column``. If set to something other than :ref:`TextServer.AUTOWRAP_OFF<class_TextServer_constant_AUTOWRAP_OFF>`, the text gets wrapped inside the cell's bounding rectangle.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_TreeItem_method_set_button:
  703. .. rst-class:: classref-method
  704. void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`Texture2D<class_Texture2D>` button **)**
  705. Sets the given column's button :ref:`Texture2D<class_Texture2D>` at index ``button_index`` to ``button``.
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _class_TreeItem_method_set_button_color:
  709. .. rst-class:: classref-method
  710. void **set_button_color** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`Color<class_Color>` color **)**
  711. Sets the given column's button color at index ``button_index`` to ``color``.
  712. .. rst-class:: classref-item-separator
  713. ----
  714. .. _class_TreeItem_method_set_button_disabled:
  715. .. rst-class:: classref-method
  716. void **set_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_index, :ref:`bool<class_bool>` disabled **)**
  717. If ``true``, disables the button at index ``button_index`` in the given ``column``.
  718. .. rst-class:: classref-item-separator
  719. ----
  720. .. _class_TreeItem_method_set_cell_mode:
  721. .. rst-class:: classref-method
  722. void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)**
  723. Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` constants.
  724. .. rst-class:: classref-item-separator
  725. ----
  726. .. _class_TreeItem_method_set_checked:
  727. .. rst-class:: classref-method
  728. void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
  729. If ``checked`` is ``true``, the given ``column`` is checked. Clears column's indeterminate status.
  730. .. rst-class:: classref-item-separator
  731. ----
  732. .. _class_TreeItem_method_set_collapsed_recursive:
  733. .. rst-class:: classref-method
  734. void **set_collapsed_recursive** **(** :ref:`bool<class_bool>` enable **)**
  735. Collapses or uncollapses this **TreeItem** and all the descendants of this item.
  736. .. rst-class:: classref-item-separator
  737. ----
  738. .. _class_TreeItem_method_set_custom_as_button:
  739. .. rst-class:: classref-method
  740. void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  741. .. container:: contribute
  742. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  743. .. rst-class:: classref-item-separator
  744. ----
  745. .. _class_TreeItem_method_set_custom_bg_color:
  746. .. rst-class:: classref-method
  747. void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)**
  748. Sets the given column's custom background color and whether to just use it as an outline.
  749. .. rst-class:: classref-item-separator
  750. ----
  751. .. _class_TreeItem_method_set_custom_color:
  752. .. rst-class:: classref-method
  753. void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)**
  754. Sets the given column's custom color.
  755. .. rst-class:: classref-item-separator
  756. ----
  757. .. _class_TreeItem_method_set_custom_draw:
  758. .. rst-class:: classref-method
  759. void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`StringName<class_StringName>` callback **)**
  760. Sets the given column's custom draw callback to ``callback`` method on ``object``.
  761. The ``callback`` should accept two arguments: the **TreeItem** that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
  762. .. rst-class:: classref-item-separator
  763. ----
  764. .. _class_TreeItem_method_set_custom_font:
  765. .. rst-class:: classref-method
  766. void **set_custom_font** **(** :ref:`int<class_int>` column, :ref:`Font<class_Font>` font **)**
  767. Sets custom font used to draw text in the given ``column``.
  768. .. rst-class:: classref-item-separator
  769. ----
  770. .. _class_TreeItem_method_set_custom_font_size:
  771. .. rst-class:: classref-method
  772. void **set_custom_font_size** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` font_size **)**
  773. Sets custom font size used to draw text in the given ``column``.
  774. .. rst-class:: classref-item-separator
  775. ----
  776. .. _class_TreeItem_method_set_edit_multiline:
  777. .. rst-class:: classref-method
  778. void **set_edit_multiline** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` multiline **)**
  779. If ``multiline`` is ``true``, the given ``column`` is multiline editable.
  780. \ **Note:** This option only affects the type of control (:ref:`LineEdit<class_LineEdit>` or :ref:`TextEdit<class_TextEdit>`) that appears when editing the column. You can set multiline values with :ref:`set_text<class_TreeItem_method_set_text>` even if the column is not multiline editable.
  781. .. rst-class:: classref-item-separator
  782. ----
  783. .. _class_TreeItem_method_set_editable:
  784. .. rst-class:: classref-method
  785. void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
  786. If ``enabled`` is ``true``, the given ``column`` is editable.
  787. .. rst-class:: classref-item-separator
  788. ----
  789. .. _class_TreeItem_method_set_expand_right:
  790. .. rst-class:: classref-method
  791. void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  792. If ``enable`` is ``true``, the given ``column`` is expanded to the right.
  793. .. rst-class:: classref-item-separator
  794. ----
  795. .. _class_TreeItem_method_set_icon:
  796. .. rst-class:: classref-method
  797. void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture2D<class_Texture2D>` texture **)**
  798. Sets the given column's icon :ref:`Texture2D<class_Texture2D>`.
  799. .. rst-class:: classref-item-separator
  800. ----
  801. .. _class_TreeItem_method_set_icon_max_width:
  802. .. rst-class:: classref-method
  803. void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
  804. Sets the maximum allowed width of the icon in the given ``column``. This limit is applied on top of the default size of the icon and on top of :ref:`Tree.icon_max_width<class_Tree_theme_constant_icon_max_width>`. The height is adjusted according to the icon's ratio.
  805. .. rst-class:: classref-item-separator
  806. ----
  807. .. _class_TreeItem_method_set_icon_modulate:
  808. .. rst-class:: classref-method
  809. void **set_icon_modulate** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)**
  810. Modulates the given column's icon with ``modulate``.
  811. .. rst-class:: classref-item-separator
  812. ----
  813. .. _class_TreeItem_method_set_icon_region:
  814. .. rst-class:: classref-method
  815. void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)**
  816. Sets the given column's icon's texture region.
  817. .. rst-class:: classref-item-separator
  818. ----
  819. .. _class_TreeItem_method_set_indeterminate:
  820. .. rst-class:: classref-method
  821. void **set_indeterminate** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` indeterminate **)**
  822. If ``indeterminate`` is ``true``, the given ``column`` is marked indeterminate.
  823. \ **Note:** If set ``true`` from ``false``, then column is cleared of checked status.
  824. .. rst-class:: classref-item-separator
  825. ----
  826. .. _class_TreeItem_method_set_language:
  827. .. rst-class:: classref-method
  828. void **set_language** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` language **)**
  829. Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  830. .. rst-class:: classref-item-separator
  831. ----
  832. .. _class_TreeItem_method_set_metadata:
  833. .. rst-class:: classref-method
  834. void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)**
  835. 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.
  836. .. rst-class:: classref-item-separator
  837. ----
  838. .. _class_TreeItem_method_set_range:
  839. .. rst-class:: classref-method
  840. void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
  841. Sets the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  842. .. rst-class:: classref-item-separator
  843. ----
  844. .. _class_TreeItem_method_set_range_config:
  845. .. rst-class:: classref-method
  846. 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 **)**
  847. 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.
  848. If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit<class_Range_property_exp_edit>`.
  849. .. rst-class:: classref-item-separator
  850. ----
  851. .. _class_TreeItem_method_set_selectable:
  852. .. rst-class:: classref-method
  853. void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
  854. If ``selectable`` is ``true``, the given ``column`` is selectable.
  855. .. rst-class:: classref-item-separator
  856. ----
  857. .. _class_TreeItem_method_set_structured_text_bidi_override:
  858. .. rst-class:: classref-method
  859. void **set_structured_text_bidi_override** **(** :ref:`int<class_int>` column, :ref:`StructuredTextParser<enum_TextServer_StructuredTextParser>` parser **)**
  860. .. container:: contribute
  861. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  862. .. rst-class:: classref-item-separator
  863. ----
  864. .. _class_TreeItem_method_set_structured_text_bidi_override_options:
  865. .. rst-class:: classref-method
  866. void **set_structured_text_bidi_override_options** **(** :ref:`int<class_int>` column, :ref:`Array<class_Array>` args **)**
  867. .. container:: contribute
  868. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_TreeItem_method_set_suffix:
  872. .. rst-class:: classref-method
  873. void **set_suffix** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  874. Sets a string to be shown after a column's value (for example, a unit abbreviation).
  875. .. rst-class:: classref-item-separator
  876. ----
  877. .. _class_TreeItem_method_set_text:
  878. .. rst-class:: classref-method
  879. void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  880. Sets the given column's text value.
  881. .. rst-class:: classref-item-separator
  882. ----
  883. .. _class_TreeItem_method_set_text_alignment:
  884. .. rst-class:: classref-method
  885. void **set_text_alignment** **(** :ref:`int<class_int>` column, :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` text_alignment **)**
  886. Sets the given column's text alignment. See :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` for possible values.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_TreeItem_method_set_text_direction:
  890. .. rst-class:: classref-method
  891. void **set_text_direction** **(** :ref:`int<class_int>` column, :ref:`TextDirection<enum_Control_TextDirection>` direction **)**
  892. Sets item's text base writing direction.
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_TreeItem_method_set_text_overrun_behavior:
  896. .. rst-class:: classref-method
  897. void **set_text_overrun_behavior** **(** :ref:`int<class_int>` column, :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` overrun_behavior **)**
  898. Sets the clipping behavior when the text exceeds the item's bounding rectangle in the given ``column``.
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_TreeItem_method_set_tooltip_text:
  902. .. rst-class:: classref-method
  903. void **set_tooltip_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)**
  904. Sets the given column's tooltip text.
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_TreeItem_method_uncollapse_tree:
  908. .. rst-class:: classref-method
  909. void **uncollapse_tree** **(** **)**
  910. .. container:: contribute
  911. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  912. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  913. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  914. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  915. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  916. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  917. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  918. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`