2
0

class_treeitem.rst 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TreeItem.xml.
  6. .. _class_TreeItem:
  7. TreeItem
  8. ========
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Control for a single item inside a :ref:`Tree<class_Tree>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Control for a single item inside a :ref:`Tree<class_Tree>`. May have child **TreeItem**\ s and be styled as well as contain buttons.
  15. You can remove a **TreeItem** by using :ref:`Object.free<class_Object_method_free>`.
  16. \ **Note:** The ID values used for buttons are limited to 32 bits, not full 64 bits of :ref:`int<class_int>`. This has a range of ``-2^32`` to ``2^32 - 1``, i.e. ``-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. .. rst-class:: classref-reftable-group
  30. Methods
  31. -------
  32. .. table::
  33. :widths: auto
  34. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_button<class_TreeItem_method_add_button>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)** |
  36. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`Variant<class_Variant>` | :ref:`call_recursive<class_TreeItem_method_call_recursive>` **(** :ref:`String<class_String>` method, ... **)** |vararg| |
  38. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`clear_custom_bg_color<class_TreeItem_method_clear_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |
  40. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`clear_custom_color<class_TreeItem_method_clear_custom_color>` **(** :ref:`int<class_int>` column **)** |
  42. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`deselect<class_TreeItem_method_deselect>` **(** :ref:`int<class_int>` column **)** |
  44. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`erase_button<class_TreeItem_method_erase_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |
  46. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Texture<class_Texture>` | :ref:`get_button<class_TreeItem_method_get_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  48. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :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| |
  50. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`get_button_count<class_TreeItem_method_get_button_count>` **(** :ref:`int<class_int>` column **)** |const| |
  52. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_button_id<class_TreeItem_method_get_button_id>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  54. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`String<class_String>` | :ref:`get_button_tooltip<class_TreeItem_method_get_button_tooltip>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  56. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` | :ref:`get_cell_mode<class_TreeItem_method_get_cell_mode>` **(** :ref:`int<class_int>` column **)** |const| |
  58. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_children<class_TreeItem_method_get_children>` **(** **)** |
  60. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`Color<class_Color>` | :ref:`get_custom_bg_color<class_TreeItem_method_get_custom_bg_color>` **(** :ref:`int<class_int>` column **)** |const| |
  62. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`Color<class_Color>` | :ref:`get_custom_color<class_TreeItem_method_get_custom_color>` **(** :ref:`int<class_int>` column **)** |const| |
  64. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`get_expand_right<class_TreeItem_method_get_expand_right>` **(** :ref:`int<class_int>` column **)** |const| |
  66. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Texture<class_Texture>` | :ref:`get_icon<class_TreeItem_method_get_icon>` **(** :ref:`int<class_int>` column **)** |const| |
  68. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_icon_max_width<class_TreeItem_method_get_icon_max_width>` **(** :ref:`int<class_int>` column **)** |const| |
  70. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Color<class_Color>` | :ref:`get_icon_modulate<class_TreeItem_method_get_icon_modulate>` **(** :ref:`int<class_int>` column **)** |const| |
  72. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`Rect2<class_Rect2>` | :ref:`get_icon_region<class_TreeItem_method_get_icon_region>` **(** :ref:`int<class_int>` column **)** |const| |
  74. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Variant<class_Variant>` | :ref:`get_metadata<class_TreeItem_method_get_metadata>` **(** :ref:`int<class_int>` column **)** |const| |
  76. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next<class_TreeItem_method_get_next>` **(** **)** |
  78. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_next_visible<class_TreeItem_method_get_next_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  80. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_parent<class_TreeItem_method_get_parent>` **(** **)** |
  82. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev<class_TreeItem_method_get_prev>` **(** **)** |
  84. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`TreeItem<class_TreeItem>` | :ref:`get_prev_visible<class_TreeItem_method_get_prev_visible>` **(** :ref:`bool<class_bool>` wrap=false **)** |
  86. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`float<class_float>` | :ref:`get_range<class_TreeItem_method_get_range>` **(** :ref:`int<class_int>` column **)** |const| |
  88. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_range_config<class_TreeItem_method_get_range_config>` **(** :ref:`int<class_int>` column **)** |
  90. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`String<class_String>` | :ref:`get_suffix<class_TreeItem_method_get_suffix>` **(** :ref:`int<class_int>` column **)** |const| |
  92. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`String<class_String>` | :ref:`get_text<class_TreeItem_method_get_text>` **(** :ref:`int<class_int>` column **)** |const| |
  94. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`TextAlign<enum_TreeItem_TextAlign>` | :ref:`get_text_align<class_TreeItem_method_get_text_align>` **(** :ref:`int<class_int>` column **)** |const| |
  96. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`String<class_String>` | :ref:`get_tooltip<class_TreeItem_method_get_tooltip>` **(** :ref:`int<class_int>` column **)** |const| |
  98. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`bool<class_bool>` | :ref:`is_button_disabled<class_TreeItem_method_is_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const| |
  100. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`bool<class_bool>` | :ref:`is_checked<class_TreeItem_method_is_checked>` **(** :ref:`int<class_int>` column **)** |const| |
  102. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`bool<class_bool>` | :ref:`is_custom_set_as_button<class_TreeItem_method_is_custom_set_as_button>` **(** :ref:`int<class_int>` column **)** |const| |
  104. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`is_editable<class_TreeItem_method_is_editable>` **(** :ref:`int<class_int>` column **)** |
  106. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`is_selectable<class_TreeItem_method_is_selectable>` **(** :ref:`int<class_int>` column **)** |const| |
  108. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`bool<class_bool>` | :ref:`is_selected<class_TreeItem_method_is_selected>` **(** :ref:`int<class_int>` column **)** |
  110. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | void | :ref:`move_to_bottom<class_TreeItem_method_move_to_bottom>` **(** **)** |
  112. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`move_to_top<class_TreeItem_method_move_to_top>` **(** **)** |
  114. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`remove_child<class_TreeItem_method_remove_child>` **(** :ref:`Object<class_Object>` child **)** |
  116. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`select<class_TreeItem_method_select>` **(** :ref:`int<class_int>` column **)** |
  118. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | void | :ref:`set_button<class_TreeItem_method_set_button>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_Texture>` button **)** |
  120. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`set_button_disabled<class_TreeItem_method_set_button_disabled>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)** |
  122. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`set_cell_mode<class_TreeItem_method_set_cell_mode>` **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)** |
  124. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`set_checked<class_TreeItem_method_set_checked>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)** |
  126. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | void | :ref:`set_custom_as_button<class_TreeItem_method_set_custom_as_button>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  128. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | 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 **)** |
  130. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | void | :ref:`set_custom_color<class_TreeItem_method_set_custom_color>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)** |
  132. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`set_custom_draw<class_TreeItem_method_set_custom_draw>` **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)** |
  134. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`set_editable<class_TreeItem_method_set_editable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)** |
  136. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`set_expand_right<class_TreeItem_method_set_expand_right>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)** |
  138. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`set_icon<class_TreeItem_method_set_icon>` **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` texture **)** |
  140. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`set_icon_max_width<class_TreeItem_method_set_icon_max_width>` **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)** |
  142. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`set_icon_modulate<class_TreeItem_method_set_icon_modulate>` **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)** |
  144. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`set_icon_region<class_TreeItem_method_set_icon_region>` **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)** |
  146. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`set_metadata<class_TreeItem_method_set_metadata>` **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)** |
  148. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | void | :ref:`set_range<class_TreeItem_method_set_range>` **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)** |
  150. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | 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 **)** |
  152. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`set_selectable<class_TreeItem_method_set_selectable>` **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)** |
  154. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | void | :ref:`set_suffix<class_TreeItem_method_set_suffix>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  156. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`set_text<class_TreeItem_method_set_text>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)** |
  158. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`set_text_align<class_TreeItem_method_set_text_align>` **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)** |
  160. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`set_tooltip<class_TreeItem_method_set_tooltip>` **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)** |
  162. +-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. .. rst-class:: classref-section-separator
  164. ----
  165. .. rst-class:: classref-descriptions-group
  166. Enumerations
  167. ------------
  168. .. _enum_TreeItem_TreeCellMode:
  169. .. rst-class:: classref-enumeration
  170. enum **TreeCellMode**:
  171. .. _class_TreeItem_constant_CELL_MODE_STRING:
  172. .. rst-class:: classref-enumeration-constant
  173. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_STRING** = ``0``
  174. Cell contains a string.
  175. .. _class_TreeItem_constant_CELL_MODE_CHECK:
  176. .. rst-class:: classref-enumeration-constant
  177. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CHECK** = ``1``
  178. Cell contains a checkbox.
  179. .. _class_TreeItem_constant_CELL_MODE_RANGE:
  180. .. rst-class:: classref-enumeration-constant
  181. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_RANGE** = ``2``
  182. Cell contains a range.
  183. .. _class_TreeItem_constant_CELL_MODE_ICON:
  184. .. rst-class:: classref-enumeration-constant
  185. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_ICON** = ``3``
  186. Cell contains an icon.
  187. .. _class_TreeItem_constant_CELL_MODE_CUSTOM:
  188. .. rst-class:: classref-enumeration-constant
  189. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **CELL_MODE_CUSTOM** = ``4``
  190. .. rst-class:: classref-item-separator
  191. ----
  192. .. _enum_TreeItem_TextAlign:
  193. .. rst-class:: classref-enumeration
  194. enum **TextAlign**:
  195. .. _class_TreeItem_constant_ALIGN_LEFT:
  196. .. rst-class:: classref-enumeration-constant
  197. :ref:`TextAlign<enum_TreeItem_TextAlign>` **ALIGN_LEFT** = ``0``
  198. Align text to the left. See ``set_text_align()``.
  199. .. _class_TreeItem_constant_ALIGN_CENTER:
  200. .. rst-class:: classref-enumeration-constant
  201. :ref:`TextAlign<enum_TreeItem_TextAlign>` **ALIGN_CENTER** = ``1``
  202. Center text. See ``set_text_align()``.
  203. .. _class_TreeItem_constant_ALIGN_RIGHT:
  204. .. rst-class:: classref-enumeration-constant
  205. :ref:`TextAlign<enum_TreeItem_TextAlign>` **ALIGN_RIGHT** = ``2``
  206. Align text to the right. See ``set_text_align()``.
  207. .. rst-class:: classref-section-separator
  208. ----
  209. .. rst-class:: classref-descriptions-group
  210. Property Descriptions
  211. ---------------------
  212. .. _class_TreeItem_property_collapsed:
  213. .. rst-class:: classref-property
  214. :ref:`bool<class_bool>` **collapsed**
  215. .. rst-class:: classref-property-setget
  216. - void **set_collapsed** **(** :ref:`bool<class_bool>` value **)**
  217. - :ref:`bool<class_bool>` **is_collapsed** **(** **)**
  218. If ``true``, the TreeItem is collapsed.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_TreeItem_property_custom_minimum_height:
  222. .. rst-class:: classref-property
  223. :ref:`int<class_int>` **custom_minimum_height**
  224. .. rst-class:: classref-property-setget
  225. - void **set_custom_minimum_height** **(** :ref:`int<class_int>` value **)**
  226. - :ref:`int<class_int>` **get_custom_minimum_height** **(** **)**
  227. The custom minimum height.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_TreeItem_property_disable_folding:
  231. .. rst-class:: classref-property
  232. :ref:`bool<class_bool>` **disable_folding**
  233. .. rst-class:: classref-property-setget
  234. - void **set_disable_folding** **(** :ref:`bool<class_bool>` value **)**
  235. - :ref:`bool<class_bool>` **is_folding_disabled** **(** **)**
  236. If ``true``, folding is disabled for this TreeItem.
  237. .. rst-class:: classref-section-separator
  238. ----
  239. .. rst-class:: classref-descriptions-group
  240. Method Descriptions
  241. -------------------
  242. .. _class_TreeItem_method_add_button:
  243. .. rst-class:: classref-method
  244. void **add_button** **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` button, :ref:`int<class_int>` id=-1, :ref:`bool<class_bool>` disabled=false, :ref:`String<class_String>` tooltip="" **)**
  245. Adds a button with :ref:`Texture<class_Texture>` ``button`` at column ``column``. The ``id`` is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count<class_TreeItem_method_get_button_count>` immediately before this method. Optionally, the button can be ``disabled`` and have a ``tooltip``.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_TreeItem_method_call_recursive:
  249. .. rst-class:: classref-method
  250. :ref:`Variant<class_Variant>` **call_recursive** **(** :ref:`String<class_String>` method, ... **)** |vararg|
  251. Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_TreeItem_method_clear_custom_bg_color:
  255. .. rst-class:: classref-method
  256. void **clear_custom_bg_color** **(** :ref:`int<class_int>` column **)**
  257. Resets the background color for the given column to default.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_TreeItem_method_clear_custom_color:
  261. .. rst-class:: classref-method
  262. void **clear_custom_color** **(** :ref:`int<class_int>` column **)**
  263. Resets the color for the given column to default.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_TreeItem_method_deselect:
  267. .. rst-class:: classref-method
  268. void **deselect** **(** :ref:`int<class_int>` column **)**
  269. Deselects the given column.
  270. .. rst-class:: classref-item-separator
  271. ----
  272. .. _class_TreeItem_method_erase_button:
  273. .. rst-class:: classref-method
  274. void **erase_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)**
  275. Removes the button at index ``button_idx`` in column ``column``.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_TreeItem_method_get_button:
  279. .. rst-class:: classref-method
  280. :ref:`Texture<class_Texture>` **get_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  281. Returns the :ref:`Texture<class_Texture>` of the button at index ``button_idx`` in column ``column``.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_TreeItem_method_get_button_by_id:
  285. .. rst-class:: classref-method
  286. :ref:`int<class_int>` **get_button_by_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` id **)** |const|
  287. Returns the button index if there is a button with id ``id`` in column ``column``, otherwise returns -1.
  288. .. rst-class:: classref-item-separator
  289. ----
  290. .. _class_TreeItem_method_get_button_count:
  291. .. rst-class:: classref-method
  292. :ref:`int<class_int>` **get_button_count** **(** :ref:`int<class_int>` column **)** |const|
  293. Returns the number of buttons in column ``column``.
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_TreeItem_method_get_button_id:
  297. .. rst-class:: classref-method
  298. :ref:`int<class_int>` **get_button_id** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  299. Returns the id for the button at index ``button_idx`` in column ``column``.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_TreeItem_method_get_button_tooltip:
  303. .. rst-class:: classref-method
  304. :ref:`String<class_String>` **get_button_tooltip** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  305. Returns the tooltip string for the button at index ``button_idx`` in column ``column``.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_TreeItem_method_get_cell_mode:
  309. .. rst-class:: classref-method
  310. :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` **get_cell_mode** **(** :ref:`int<class_int>` column **)** |const|
  311. Returns the column's cell mode.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_TreeItem_method_get_children:
  315. .. rst-class:: classref-method
  316. :ref:`TreeItem<class_TreeItem>` **get_children** **(** **)**
  317. Returns the TreeItem's first child item or a null object if there is none.
  318. .. rst-class:: classref-item-separator
  319. ----
  320. .. _class_TreeItem_method_get_custom_bg_color:
  321. .. rst-class:: classref-method
  322. :ref:`Color<class_Color>` **get_custom_bg_color** **(** :ref:`int<class_int>` column **)** |const|
  323. Returns the custom background color of column ``column``.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_TreeItem_method_get_custom_color:
  327. .. rst-class:: classref-method
  328. :ref:`Color<class_Color>` **get_custom_color** **(** :ref:`int<class_int>` column **)** |const|
  329. Returns the custom color of column ``column``.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_TreeItem_method_get_expand_right:
  333. .. rst-class:: classref-method
  334. :ref:`bool<class_bool>` **get_expand_right** **(** :ref:`int<class_int>` column **)** |const|
  335. Returns ``true`` if ``expand_right`` is set.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_TreeItem_method_get_icon:
  339. .. rst-class:: classref-method
  340. :ref:`Texture<class_Texture>` **get_icon** **(** :ref:`int<class_int>` column **)** |const|
  341. Returns the given column's icon :ref:`Texture<class_Texture>`. Error if no icon is set.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_TreeItem_method_get_icon_max_width:
  345. .. rst-class:: classref-method
  346. :ref:`int<class_int>` **get_icon_max_width** **(** :ref:`int<class_int>` column **)** |const|
  347. Returns the column's icon's maximum width.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_TreeItem_method_get_icon_modulate:
  351. .. rst-class:: classref-method
  352. :ref:`Color<class_Color>` **get_icon_modulate** **(** :ref:`int<class_int>` column **)** |const|
  353. Returns the :ref:`Color<class_Color>` modulating the column's icon.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_TreeItem_method_get_icon_region:
  357. .. rst-class:: classref-method
  358. :ref:`Rect2<class_Rect2>` **get_icon_region** **(** :ref:`int<class_int>` column **)** |const|
  359. Returns the icon :ref:`Texture<class_Texture>` region as :ref:`Rect2<class_Rect2>`.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_TreeItem_method_get_metadata:
  363. .. rst-class:: classref-method
  364. :ref:`Variant<class_Variant>` **get_metadata** **(** :ref:`int<class_int>` column **)** |const|
  365. Returns the metadata value that was set for the given column using :ref:`set_metadata<class_TreeItem_method_set_metadata>`.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_TreeItem_method_get_next:
  369. .. rst-class:: classref-method
  370. :ref:`TreeItem<class_TreeItem>` **get_next** **(** **)**
  371. Returns the next sibling TreeItem in the tree or a null object if there is none.
  372. .. rst-class:: classref-item-separator
  373. ----
  374. .. _class_TreeItem_method_get_next_visible:
  375. .. rst-class:: classref-method
  376. :ref:`TreeItem<class_TreeItem>` **get_next_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  377. Returns the next visible sibling TreeItem in the tree or a null object if there is none.
  378. 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``.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_TreeItem_method_get_parent:
  382. .. rst-class:: classref-method
  383. :ref:`TreeItem<class_TreeItem>` **get_parent** **(** **)**
  384. Returns the parent TreeItem or a null object if there is none.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_TreeItem_method_get_prev:
  388. .. rst-class:: classref-method
  389. :ref:`TreeItem<class_TreeItem>` **get_prev** **(** **)**
  390. Returns the previous sibling TreeItem in the tree or a null object if there is none.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_TreeItem_method_get_prev_visible:
  394. .. rst-class:: classref-method
  395. :ref:`TreeItem<class_TreeItem>` **get_prev_visible** **(** :ref:`bool<class_bool>` wrap=false **)**
  396. Returns the previous visible sibling TreeItem in the tree or a null object if there is none.
  397. 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``.
  398. .. rst-class:: classref-item-separator
  399. ----
  400. .. _class_TreeItem_method_get_range:
  401. .. rst-class:: classref-method
  402. :ref:`float<class_float>` **get_range** **(** :ref:`int<class_int>` column **)** |const|
  403. Returns the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  404. .. rst-class:: classref-item-separator
  405. ----
  406. .. _class_TreeItem_method_get_range_config:
  407. .. rst-class:: classref-method
  408. :ref:`Dictionary<class_Dictionary>` **get_range_config** **(** :ref:`int<class_int>` column **)**
  409. Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
  410. .. rst-class:: classref-item-separator
  411. ----
  412. .. _class_TreeItem_method_get_suffix:
  413. .. rst-class:: classref-method
  414. :ref:`String<class_String>` **get_suffix** **(** :ref:`int<class_int>` column **)** |const|
  415. Gets the suffix string shown after the column value.
  416. .. rst-class:: classref-item-separator
  417. ----
  418. .. _class_TreeItem_method_get_text:
  419. .. rst-class:: classref-method
  420. :ref:`String<class_String>` **get_text** **(** :ref:`int<class_int>` column **)** |const|
  421. Returns the given column's text.
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_TreeItem_method_get_text_align:
  425. .. rst-class:: classref-method
  426. :ref:`TextAlign<enum_TreeItem_TextAlign>` **get_text_align** **(** :ref:`int<class_int>` column **)** |const|
  427. Returns the given column's text alignment.
  428. .. rst-class:: classref-item-separator
  429. ----
  430. .. _class_TreeItem_method_get_tooltip:
  431. .. rst-class:: classref-method
  432. :ref:`String<class_String>` **get_tooltip** **(** :ref:`int<class_int>` column **)** |const|
  433. Returns the given column's tooltip.
  434. .. rst-class:: classref-item-separator
  435. ----
  436. .. _class_TreeItem_method_is_button_disabled:
  437. .. rst-class:: classref-method
  438. :ref:`bool<class_bool>` **is_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx **)** |const|
  439. Returns ``true`` if the button at index ``button_idx`` for the given column is disabled.
  440. .. rst-class:: classref-item-separator
  441. ----
  442. .. _class_TreeItem_method_is_checked:
  443. .. rst-class:: classref-method
  444. :ref:`bool<class_bool>` **is_checked** **(** :ref:`int<class_int>` column **)** |const|
  445. Returns ``true`` if the given column is checked.
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_TreeItem_method_is_custom_set_as_button:
  449. .. rst-class:: classref-method
  450. :ref:`bool<class_bool>` **is_custom_set_as_button** **(** :ref:`int<class_int>` column **)** |const|
  451. .. container:: contribute
  452. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  453. .. rst-class:: classref-item-separator
  454. ----
  455. .. _class_TreeItem_method_is_editable:
  456. .. rst-class:: classref-method
  457. :ref:`bool<class_bool>` **is_editable** **(** :ref:`int<class_int>` column **)**
  458. Returns ``true`` if column ``column`` is editable.
  459. .. rst-class:: classref-item-separator
  460. ----
  461. .. _class_TreeItem_method_is_selectable:
  462. .. rst-class:: classref-method
  463. :ref:`bool<class_bool>` **is_selectable** **(** :ref:`int<class_int>` column **)** |const|
  464. Returns ``true`` if column ``column`` is selectable.
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_TreeItem_method_is_selected:
  468. .. rst-class:: classref-method
  469. :ref:`bool<class_bool>` **is_selected** **(** :ref:`int<class_int>` column **)**
  470. Returns ``true`` if column ``column`` is selected.
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _class_TreeItem_method_move_to_bottom:
  474. .. rst-class:: classref-method
  475. void **move_to_bottom** **(** **)**
  476. Moves this TreeItem to the bottom in the :ref:`Tree<class_Tree>` hierarchy.
  477. .. rst-class:: classref-item-separator
  478. ----
  479. .. _class_TreeItem_method_move_to_top:
  480. .. rst-class:: classref-method
  481. void **move_to_top** **(** **)**
  482. Moves this TreeItem to the top in the :ref:`Tree<class_Tree>` hierarchy.
  483. .. rst-class:: classref-item-separator
  484. ----
  485. .. _class_TreeItem_method_remove_child:
  486. .. rst-class:: classref-method
  487. void **remove_child** **(** :ref:`Object<class_Object>` child **)**
  488. 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>`.
  489. .. rst-class:: classref-item-separator
  490. ----
  491. .. _class_TreeItem_method_select:
  492. .. rst-class:: classref-method
  493. void **select** **(** :ref:`int<class_int>` column **)**
  494. Selects the column ``column``.
  495. .. rst-class:: classref-item-separator
  496. ----
  497. .. _class_TreeItem_method_set_button:
  498. .. rst-class:: classref-method
  499. void **set_button** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`Texture<class_Texture>` button **)**
  500. Sets the given column's button :ref:`Texture<class_Texture>` at index ``button_idx`` to ``button``.
  501. .. rst-class:: classref-item-separator
  502. ----
  503. .. _class_TreeItem_method_set_button_disabled:
  504. .. rst-class:: classref-method
  505. void **set_button_disabled** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` button_idx, :ref:`bool<class_bool>` disabled **)**
  506. If ``true``, disables the button at index ``button_idx`` in column ``column``.
  507. .. rst-class:: classref-item-separator
  508. ----
  509. .. _class_TreeItem_method_set_cell_mode:
  510. .. rst-class:: classref-method
  511. void **set_cell_mode** **(** :ref:`int<class_int>` column, :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` mode **)**
  512. Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode<enum_TreeItem_TreeCellMode>` constants.
  513. .. rst-class:: classref-item-separator
  514. ----
  515. .. _class_TreeItem_method_set_checked:
  516. .. rst-class:: classref-method
  517. void **set_checked** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` checked **)**
  518. If ``true``, the column ``column`` is checked.
  519. .. rst-class:: classref-item-separator
  520. ----
  521. .. _class_TreeItem_method_set_custom_as_button:
  522. .. rst-class:: classref-method
  523. void **set_custom_as_button** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  524. .. container:: contribute
  525. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  526. .. rst-class:: classref-item-separator
  527. ----
  528. .. _class_TreeItem_method_set_custom_bg_color:
  529. .. rst-class:: classref-method
  530. void **set_custom_bg_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color, :ref:`bool<class_bool>` just_outline=false **)**
  531. Sets the given column's custom background color and whether to just use it as an outline.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_TreeItem_method_set_custom_color:
  535. .. rst-class:: classref-method
  536. void **set_custom_color** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` color **)**
  537. Sets the given column's custom color.
  538. .. rst-class:: classref-item-separator
  539. ----
  540. .. _class_TreeItem_method_set_custom_draw:
  541. .. rst-class:: classref-method
  542. void **set_custom_draw** **(** :ref:`int<class_int>` column, :ref:`Object<class_Object>` object, :ref:`String<class_String>` callback **)**
  543. Sets the given column's custom draw callback to ``callback`` method on ``object``.
  544. The ``callback`` should accept two arguments: the **TreeItem** that is drawn and its position and size as a :ref:`Rect2<class_Rect2>`.
  545. .. rst-class:: classref-item-separator
  546. ----
  547. .. _class_TreeItem_method_set_editable:
  548. .. rst-class:: classref-method
  549. void **set_editable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enabled **)**
  550. If ``true``, column ``column`` is editable.
  551. .. rst-class:: classref-item-separator
  552. ----
  553. .. _class_TreeItem_method_set_expand_right:
  554. .. rst-class:: classref-method
  555. void **set_expand_right** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` enable **)**
  556. If ``true``, column ``column`` is expanded to the right.
  557. .. rst-class:: classref-item-separator
  558. ----
  559. .. _class_TreeItem_method_set_icon:
  560. .. rst-class:: classref-method
  561. void **set_icon** **(** :ref:`int<class_int>` column, :ref:`Texture<class_Texture>` texture **)**
  562. Sets the given column's icon :ref:`Texture<class_Texture>`.
  563. .. rst-class:: classref-item-separator
  564. ----
  565. .. _class_TreeItem_method_set_icon_max_width:
  566. .. rst-class:: classref-method
  567. void **set_icon_max_width** **(** :ref:`int<class_int>` column, :ref:`int<class_int>` width **)**
  568. Sets the given column's icon's maximum width.
  569. .. rst-class:: classref-item-separator
  570. ----
  571. .. _class_TreeItem_method_set_icon_modulate:
  572. .. rst-class:: classref-method
  573. void **set_icon_modulate** **(** :ref:`int<class_int>` column, :ref:`Color<class_Color>` modulate **)**
  574. Modulates the given column's icon with ``modulate``.
  575. .. rst-class:: classref-item-separator
  576. ----
  577. .. _class_TreeItem_method_set_icon_region:
  578. .. rst-class:: classref-method
  579. void **set_icon_region** **(** :ref:`int<class_int>` column, :ref:`Rect2<class_Rect2>` region **)**
  580. Sets the given column's icon's texture region.
  581. .. rst-class:: classref-item-separator
  582. ----
  583. .. _class_TreeItem_method_set_metadata:
  584. .. rst-class:: classref-method
  585. void **set_metadata** **(** :ref:`int<class_int>` column, :ref:`Variant<class_Variant>` meta **)**
  586. 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.
  587. .. rst-class:: classref-item-separator
  588. ----
  589. .. _class_TreeItem_method_set_range:
  590. .. rst-class:: classref-method
  591. void **set_range** **(** :ref:`int<class_int>` column, :ref:`float<class_float>` value **)**
  592. Sets the value of a :ref:`CELL_MODE_RANGE<class_TreeItem_constant_CELL_MODE_RANGE>` column.
  593. .. rst-class:: classref-item-separator
  594. ----
  595. .. _class_TreeItem_method_set_range_config:
  596. .. rst-class:: classref-method
  597. 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 **)**
  598. 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.
  599. If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit<class_Range_property_exp_edit>`.
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_TreeItem_method_set_selectable:
  603. .. rst-class:: classref-method
  604. void **set_selectable** **(** :ref:`int<class_int>` column, :ref:`bool<class_bool>` selectable **)**
  605. If ``true``, the given column is selectable.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_TreeItem_method_set_suffix:
  609. .. rst-class:: classref-method
  610. void **set_suffix** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  611. Sets a string to be shown after a column's value (for example, a unit abbreviation).
  612. .. rst-class:: classref-item-separator
  613. ----
  614. .. _class_TreeItem_method_set_text:
  615. .. rst-class:: classref-method
  616. void **set_text** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` text **)**
  617. Sets the given column's text value.
  618. .. rst-class:: classref-item-separator
  619. ----
  620. .. _class_TreeItem_method_set_text_align:
  621. .. rst-class:: classref-method
  622. void **set_text_align** **(** :ref:`int<class_int>` column, :ref:`TextAlign<enum_TreeItem_TextAlign>` text_align **)**
  623. Sets the given column's text alignment. See :ref:`TextAlign<enum_TreeItem_TextAlign>` for possible values.
  624. .. rst-class:: classref-item-separator
  625. ----
  626. .. _class_TreeItem_method_set_tooltip:
  627. .. rst-class:: classref-method
  628. void **set_tooltip** **(** :ref:`int<class_int>` column, :ref:`String<class_String>` tooltip **)**
  629. Sets the given column's tooltip text.
  630. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  631. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  632. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  633. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`