class_treeitem.rst 102 KB

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