class_treeitem.rst 91 KB

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