Debian Codegraph @

doc/classes/TreeItem.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="TreeItem" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 An internal control for a single item inside [Tree].
5 </brief_description>
6 <description>
7 A single item of a [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 [Node], it is internal to the [Tree].
8 To create a [TreeItem], use [method Tree.create_item] or [method TreeItem.create_child]. To remove a [TreeItem], use [method Object.free].
9 [b]Note:[/b] The ID values used for buttons are 32-bit, unlike [int] which is always 64-bit. They go from [code]-2147483648[/code] to [code]2147483647[/code].
10 </description>
11 <tutorials>
12 </tutorials>
13 <methods>
14 <method name="add_button">
15 <return type="void" />
16 <param index="0" name="column" type="int" />
17 <param index="1" name="button" type="Texture2D" />
18 <param index="2" name="id" type="int" default="-1" />
19 <param index="3" name="disabled" type="bool" default="false" />
20 <param index="4" name="tooltip_text" type="String" default="&quot;&quot;" />
21 <param index="5" name="description" type="String" default="&quot;&quot;" />
22 <description>
23 Adds a button with [Texture2D] [param button] to the end of the cell at column [param column]. The [param id] is used to identify the button in the according [signal Tree.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 [method get_button_count] immediately before this method. Optionally, the button can be [param disabled] and have a [param tooltip_text]. [param description] is used as the button description for assistive apps.
24 </description>
25 </method>
26 <method name="add_child">
27 <return type="void" />
28 <param index="0" name="child" type="TreeItem" />
29 <description>
30 Adds a previously unparented [TreeItem] as a direct child of this one. The [param child] item must not be a part of any [Tree] or parented to any [TreeItem]. See also [method remove_child].
31 </description>
32 </method>
33 <method name="call_recursive" qualifiers="vararg">
34 <return type="void" />
35 <param index="0" name="method" type="StringName" />
36 <description>
37 Calls the [param method] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list.
38 </description>
39 </method>
40 <method name="clear_buttons">
41 <return type="void" />
42 <description>
43 Removes all buttons from all columns of this item.
44 </description>
45 </method>
46 <method name="clear_custom_bg_color">
47 <return type="void" />
48 <param index="0" name="column" type="int" />
49 <description>
50 Resets the background color for the given column to default.
51 </description>
52 </method>
53 <method name="clear_custom_color">
54 <return type="void" />
55 <param index="0" name="column" type="int" />
56 <description>
57 Resets the color for the given column to default.
58 </description>
59 </method>
60 <method name="create_child">
61 <return type="TreeItem" />
62 <param index="0" name="index" type="int" default="-1" />
63 <description>
64 Creates an item and adds it as a child.
65 The new item will be inserted as position [param index] (the default value [code]-1[/code] means the last position), or it will be the last child if [param index] is higher than the child count.
66 </description>
67 </method>
68 <method name="deselect">
69 <return type="void" />
70 <param index="0" name="column" type="int" />
71 <description>
72 Deselects the given column.
73 </description>
74 </method>
75 <method name="erase_button">
76 <return type="void" />
77 <param index="0" name="column" type="int" />
78 <param index="1" name="button_index" type="int" />
79 <description>
80 Removes the button at index [param button_index] in column [param column].
81 </description>
82 </method>
83 <method name="get_auto_translate_mode" qualifiers="const">
84 <return type="int" enum="Node.AutoTranslateMode" />
85 <param index="0" name="column" type="int" />
86 <description>
87 Returns the column's auto translate mode.
88 </description>
89 </method>
90 <method name="get_autowrap_mode" qualifiers="const">
91 <return type="int" enum="TextServer.AutowrapMode" />
92 <param index="0" name="column" type="int" />
93 <description>
94 Returns the text autowrap mode in the given [param column]. By default it is [constant TextServer.AUTOWRAP_OFF].
95 </description>
96 </method>
97 <method name="get_button" qualifiers="const">
98 <return type="Texture2D" />
99 <param index="0" name="column" type="int" />
100 <param index="1" name="button_index" type="int" />
101 <description>
102 Returns the [Texture2D] of the button at index [param button_index] in column [param column].
103 </description>
104 </method>
105 <method name="get_button_by_id" qualifiers="const">
106 <return type="int" />
107 <param index="0" name="column" type="int" />
108 <param index="1" name="id" type="int" />
109 <description>
110 Returns the button index if there is a button with ID [param id] in column [param column], otherwise returns -1.
111 </description>
112 </method>
113 <method name="get_button_color" qualifiers="const">
114 <return type="Color" />
115 <param index="0" name="column" type="int" />
116 <param index="1" name="id" type="int" />
117 <description>
118 Returns the color of the button with ID [param id] in column [param column]. If the specified button does not exist, returns [constant Color.BLACK].
119 </description>
120 </method>
121 <method name="get_button_count" qualifiers="const">
122 <return type="int" />
123 <param index="0" name="column" type="int" />
124 <description>
125 Returns the number of buttons in column [param column].
126 </description>
127 </method>
128 <method name="get_button_id" qualifiers="const">
129 <return type="int" />
130 <param index="0" name="column" type="int" />
131 <param index="1" name="button_index" type="int" />
132 <description>
133 Returns the ID for the button at index [param button_index] in column [param column].
134 </description>
135 </method>
136 <method name="get_button_tooltip_text" qualifiers="const">
137 <return type="String" />
138 <param index="0" name="column" type="int" />
139 <param index="1" name="button_index" type="int" />
140 <description>
141 Returns the tooltip text for the button at index [param button_index] in column [param column].
142 </description>
143 </method>
144 <method name="get_cell_mode" qualifiers="const">
145 <return type="int" enum="TreeItem.TreeCellMode" />
146 <param index="0" name="column" type="int" />
147 <description>
148 Returns the column's cell mode.
149 </description>
150 </method>
151 <method name="get_child">
152 <return type="TreeItem" />
153 <param index="0" name="index" type="int" />
154 <description>
155 Returns a child item by its [param index] (see [method get_child_count]). This method is often used for iterating all children of an item.
156 Negative indices access the children from the last one.
157 </description>
158 </method>
159 <method name="get_child_count">
160 <return type="int" />
161 <description>
162 Returns the number of child items.
163 </description>
164 </method>
165 <method name="get_children">
166 <return type="TreeItem[]" />
167 <description>
168 Returns an array of references to the item's children.
169 </description>
170 </method>
171 <method name="get_custom_bg_color" qualifiers="const">
172 <return type="Color" />
173 <param index="0" name="column" type="int" />
174 <description>
175 Returns the custom background color of column [param column].
176 </description>
177 </method>
178 <method name="get_custom_color" qualifiers="const">
179 <return type="Color" />
180 <param index="0" name="column" type="int" />
181 <description>
182 Returns the custom color of column [param column].
183 </description>
184 </method>
185 <method name="get_custom_draw_callback" qualifiers="const">
186 <return type="Callable" />
187 <param index="0" name="column" type="int" />
188 <description>
189 Returns the custom callback of column [param column].
190 </description>
191 </method>
192 <method name="get_custom_font" qualifiers="const">
193 <return type="Font" />
194 <param index="0" name="column" type="int" />
195 <description>
196 Returns custom font used to draw text in the column [param column].
197 </description>
198 </method>
199 <method name="get_custom_font_size" qualifiers="const">
200 <return type="int" />
201 <param index="0" name="column" type="int" />
202 <description>
203 Returns custom font size used to draw text in the column [param column].
204 </description>
205 </method>
206 <method name="get_custom_stylebox" qualifiers="const">
207 <return type="StyleBox" />
208 <param index="0" name="column" type="int" />
209 <description>
210 Returns the given column's custom [StyleBox] used to draw the background.
211 </description>
212 </method>
213 <method name="get_description" qualifiers="const">
214 <return type="String" />
215 <param index="0" name="column" type="int" />
216 <description>
217 Returns the given column's description for assistive apps.
218 </description>
219 </method>
220 <method name="get_expand_right" qualifiers="const">
221 <return type="bool" />
222 <param index="0" name="column" type="int" />
223 <description>
224 Returns [code]true[/code] if [code]expand_right[/code] is set.
225 </description>
226 </method>
227 <method name="get_first_child" qualifiers="const">
228 <return type="TreeItem" />
229 <description>
230 Returns the TreeItem's first child.
231 </description>
232 </method>
233 <method name="get_icon" qualifiers="const">
234 <return type="Texture2D" />
235 <param index="0" name="column" type="int" />
236 <description>
237 Returns the given column's icon [Texture2D]. Error if no icon is set.
238 </description>
239 </method>
240 <method name="get_icon_max_width" qualifiers="const">
241 <return type="int" />
242 <param index="0" name="column" type="int" />
243 <description>
244 Returns the maximum allowed width of the icon in the given [param column].
245 </description>
246 </method>
247 <method name="get_icon_modulate" qualifiers="const">
248 <return type="Color" />
249 <param index="0" name="column" type="int" />
250 <description>
251 Returns the [Color] modulating the column's icon.
252 </description>
253 </method>
254 <method name="get_icon_overlay" qualifiers="const">
255 <return type="Texture2D" />
256 <param index="0" name="column" type="int" />
257 <description>
258 Returns the given column's icon overlay [Texture2D].
259 </description>
260 </method>
261 <method name="get_icon_region" qualifiers="const">
262 <return type="Rect2" />
263 <param index="0" name="column" type="int" />
264 <description>
265 Returns the icon [Texture2D] region as [Rect2].
266 </description>
267 </method>
268 <method name="get_index">
269 <return type="int" />
270 <description>
271 Returns the node's order in the tree. For example, if called on the first child item the position is [code]0[/code].
272 </description>
273 </method>
274 <method name="get_language" qualifiers="const">
275 <return type="String" />
276 <param index="0" name="column" type="int" />
277 <description>
278 Returns item's text language code.
279 </description>
280 </method>
281 <method name="get_metadata" qualifiers="const">
282 <return type="Variant" />
283 <param index="0" name="column" type="int" />
284 <description>
285 Returns the metadata value that was set for the given column using [method set_metadata].
286 </description>
287 </method>
288 <method name="get_next" qualifiers="const">
289 <return type="TreeItem" />
290 <description>
291 Returns the next sibling TreeItem in the tree or a [code]null[/code] object if there is none.
292 </description>
293 </method>
294 <method name="get_next_in_tree">
295 <return type="TreeItem" />
296 <param index="0" name="wrap" type="bool" default="false" />
297 <description>
298 Returns the next TreeItem in the tree (in the context of a depth-first search) or a [code]null[/code] object if there is none.
299 If [param wrap] is enabled, the method will wrap around to the first element in the tree when called on the last element, otherwise it returns [code]null[/code].
300 </description>
301 </method>
302 <method name="get_next_visible">
303 <return type="TreeItem" />
304 <param index="0" name="wrap" type="bool" default="false" />
305 <description>
306 Returns the next visible TreeItem in the tree (in the context of a depth-first search) or a [code]null[/code] object if there is none.
307 If [param 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 [code]null[/code].
308 </description>
309 </method>
310 <method name="get_parent" qualifiers="const">
311 <return type="TreeItem" />
312 <description>
313 Returns the parent TreeItem or a [code]null[/code] object if there is none.
314 </description>
315 </method>
316 <method name="get_prev">
317 <return type="TreeItem" />
318 <description>
319 Returns the previous sibling TreeItem in the tree or a [code]null[/code] object if there is none.
320 </description>
321 </method>
322 <method name="get_prev_in_tree">
323 <return type="TreeItem" />
324 <param index="0" name="wrap" type="bool" default="false" />
325 <description>
326 Returns the previous TreeItem in the tree (in the context of a depth-first search) or a [code]null[/code] object if there is none.
327 If [param wrap] is enabled, the method will wrap around to the last element in the tree when called on the first visible element, otherwise it returns [code]null[/code].
328 </description>
329 </method>
330 <method name="get_prev_visible">
331 <return type="TreeItem" />
332 <param index="0" name="wrap" type="bool" default="false" />
333 <description>
334 Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first search) or a [code]null[/code] object if there is none.
335 If [param 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 [code]null[/code].
336 </description>
337 </method>
338 <method name="get_range" qualifiers="const">
339 <return type="float" />
340 <param index="0" name="column" type="int" />
341 <description>
342 Returns the value of a [constant CELL_MODE_RANGE] column.
343 </description>
344 </method>
345 <method name="get_range_config">
346 <return type="Dictionary" />
347 <param index="0" name="column" type="int" />
348 <description>
349 Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
350 </description>
351 </method>
352 <method name="get_structured_text_bidi_override" qualifiers="const">
353 <return type="int" enum="TextServer.StructuredTextParser" />
354 <param index="0" name="column" type="int" />
355 <description>
356 Returns the BiDi algorithm override set for this cell.
357 </description>
358 </method>
359 <method name="get_structured_text_bidi_override_options" qualifiers="const">
360 <return type="Array" />
361 <param index="0" name="column" type="int" />
362 <description>
363 Returns the additional BiDi options set for this cell.
364 </description>
365 </method>
366 <method name="get_suffix" qualifiers="const">
367 <return type="String" />
368 <param index="0" name="column" type="int" />
369 <description>
370 Gets the suffix string shown after the column value.
371 </description>
372 </method>
373 <method name="get_text" qualifiers="const">
374 <return type="String" />
375 <param index="0" name="column" type="int" />
376 <description>
377 Returns the given column's text.
378 </description>
379 </method>
380 <method name="get_text_alignment" qualifiers="const">
381 <return type="int" enum="HorizontalAlignment" />
382 <param index="0" name="column" type="int" />
383 <description>
384 Returns the given column's text alignment.
385 </description>
386 </method>
387 <method name="get_text_direction" qualifiers="const">
388 <return type="int" enum="Control.TextDirection" />
389 <param index="0" name="column" type="int" />
390 <description>
391 Returns item's text base writing direction.
392 </description>
393 </method>
394 <method name="get_text_overrun_behavior" qualifiers="const">
395 <return type="int" enum="TextServer.OverrunBehavior" />
396 <param index="0" name="column" type="int" />
397 <description>
398 Returns the clipping behavior when the text exceeds the item's bounding rectangle in the given [param column]. By default it is [constant TextServer.OVERRUN_TRIM_ELLIPSIS].
399 </description>
400 </method>
401 <method name="get_tooltip_text" qualifiers="const">
402 <return type="String" />
403 <param index="0" name="column" type="int" />
404 <description>
405 Returns the given column's tooltip text.
406 </description>
407 </method>
408 <method name="get_tree" qualifiers="const">
409 <return type="Tree" />
410 <description>
411 Returns the [Tree] that owns this TreeItem.
412 </description>
413 </method>
414 <method name="is_any_collapsed">
415 <return type="bool" />
416 <param index="0" name="only_visible" type="bool" default="false" />
417 <description>
418 Returns [code]true[/code] if this [TreeItem], or any of its descendants, is collapsed.
419 If [param only_visible] is [code]true[/code] it ignores non-visible [TreeItem]s.
420 </description>
421 </method>
422 <method name="is_button_disabled" qualifiers="const">
423 <return type="bool" />
424 <param index="0" name="column" type="int" />
425 <param index="1" name="button_index" type="int" />
426 <description>
427 Returns [code]true[/code] if the button at index [param button_index] for the given [param column] is disabled.
428 </description>
429 </method>
430 <method name="is_checked" qualifiers="const">
431 <return type="bool" />
432 <param index="0" name="column" type="int" />
433 <description>
434 Returns [code]true[/code] if the given [param column] is checked.
435 </description>
436 </method>
437 <method name="is_custom_set_as_button" qualifiers="const">
438 <return type="bool" />
439 <param index="0" name="column" type="int" />
440 <description>
441 Returns [code]true[/code] if the cell was made into a button with [method set_custom_as_button].
442 </description>
443 </method>
444 <method name="is_edit_multiline" qualifiers="const">
445 <return type="bool" />
446 <param index="0" name="column" type="int" />
447 <description>
448 Returns [code]true[/code] if the given [param column] is multiline editable.
449 </description>
450 </method>
451 <method name="is_editable">
452 <return type="bool" />
453 <param index="0" name="column" type="int" />
454 <description>
455 Returns [code]true[/code] if the given [param column] is editable.
456 </description>
457 </method>
458 <method name="is_indeterminate" qualifiers="const">
459 <return type="bool" />
460 <param index="0" name="column" type="int" />
461 <description>
462 Returns [code]true[/code] if the given [param column] is indeterminate.
463 </description>
464 </method>
465 <method name="is_selectable" qualifiers="const">
466 <return type="bool" />
467 <param index="0" name="column" type="int" />
468 <description>
469 Returns [code]true[/code] if the given [param column] is selectable.
470 </description>
471 </method>
472 <method name="is_selected">
473 <return type="bool" />
474 <param index="0" name="column" type="int" />
475 <description>
476 Returns [code]true[/code] if the given [param column] is selected.
477 </description>
478 </method>
479 <method name="is_visible_in_tree" qualifiers="const">
480 <return type="bool" />
481 <description>
482 Returns [code]true[/code] if [member visible] is [code]true[/code] and all its ancestors are also visible.
483 </description>
484 </method>
485 <method name="move_after">
486 <return type="void" />
487 <param index="0" name="item" type="TreeItem" />
488 <description>
489 Moves this TreeItem right after the given [param item].
490 [b]Note:[/b] You can't move to the root or move the root.
491 </description>
492 </method>
493 <method name="move_before">
494 <return type="void" />
495 <param index="0" name="item" type="TreeItem" />
496 <description>
497 Moves this TreeItem right before the given [param item].
498 [b]Note:[/b] You can't move to the root or move the root.
499 </description>
500 </method>
501 <method name="propagate_check">
502 <return type="void" />
503 <param index="0" name="column" type="int" />
504 <param index="1" name="emit_signal" type="bool" default="true" />
505 <description>
506 Propagates this item's checked status to its children and parents for the given [param column]. It is possible to process the items affected by this method call by connecting to [signal Tree.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 [param emit_signal] is [code]false[/code], then [signal Tree.check_propagated_to_item] will not be emitted.
507 </description>
508 </method>
509 <method name="remove_child">
510 <return type="void" />
511 <param index="0" name="child" type="TreeItem" />
512 <description>
513 Removes the given child [TreeItem] and all its children from the [Tree]. Note that it doesn't free the item from memory, so it can be reused later (see [method add_child]). To completely remove a [TreeItem] use [method Object.free].
514 [b]Note:[/b] If you want to move a child from one [Tree] to another, then instead of removing and adding it manually you can use [method move_before] or [method move_after].
515 </description>
516 </method>
517 <method name="select">
518 <return type="void" />
519 <param index="0" name="column" type="int" />
520 <description>
521 Selects the given [param column].
522 </description>
523 </method>
524 <method name="set_auto_translate_mode">
525 <return type="void" />
526 <param index="0" name="column" type="int" />
527 <param index="1" name="mode" type="int" enum="Node.AutoTranslateMode" />
528 <description>
529 Sets the given column's auto translate mode to [param mode].
530 All columns use [constant Node.AUTO_TRANSLATE_MODE_INHERIT] by default, which uses the same auto translate mode as the [Tree] itself.
531 </description>
532 </method>
533 <method name="set_autowrap_mode">
534 <return type="void" />
535 <param index="0" name="column" type="int" />
536 <param index="1" name="autowrap_mode" type="int" enum="TextServer.AutowrapMode" />
537 <description>
538 Sets the autowrap mode in the given [param column]. If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the cell's bounding rectangle.
539 </description>
540 </method>
541 <method name="set_button">
542 <return type="void" />
543 <param index="0" name="column" type="int" />
544 <param index="1" name="button_index" type="int" />
545 <param index="2" name="button" type="Texture2D" />
546 <description>
547 Sets the given column's button [Texture2D] at index [param button_index] to [param button].
548 </description>
549 </method>
550 <method name="set_button_color">
551 <return type="void" />
552 <param index="0" name="column" type="int" />
553 <param index="1" name="button_index" type="int" />
554 <param index="2" name="color" type="Color" />
555 <description>
556 Sets the given column's button color at index [param button_index] to [param color].
557 </description>
558 </method>
559 <method name="set_button_description">
560 <return type="void" />
561 <param index="0" name="column" type="int" />
562 <param index="1" name="button_index" type="int" />
563 <param index="2" name="description" type="String" />
564 <description>
565 Sets the given column's button description at index [param button_index] for assistive apps.
566 </description>
567 </method>
568 <method name="set_button_disabled">
569 <return type="void" />
570 <param index="0" name="column" type="int" />
571 <param index="1" name="button_index" type="int" />
572 <param index="2" name="disabled" type="bool" />
573 <description>
574 If [code]true[/code], disables the button at index [param button_index] in the given [param column].
575 </description>
576 </method>
577 <method name="set_button_tooltip_text">
578 <return type="void" />
579 <param index="0" name="column" type="int" />
580 <param index="1" name="button_index" type="int" />
581 <param index="2" name="tooltip" type="String" />
582 <description>
583 Sets the tooltip text for the button at index [param button_index] in the given [param column].
584 </description>
585 </method>
586 <method name="set_cell_mode">
587 <return type="void" />
588 <param index="0" name="column" type="int" />
589 <param index="1" name="mode" type="int" enum="TreeItem.TreeCellMode" />
590 <description>
591 Sets the given column's cell mode to [param mode]. This determines how the cell is displayed and edited.
592 </description>
593 </method>
594 <method name="set_checked">
595 <return type="void" />
596 <param index="0" name="column" type="int" />
597 <param index="1" name="checked" type="bool" />
598 <description>
599 If [param checked] is [code]true[/code], the given [param column] is checked. Clears column's indeterminate status.
600 </description>
601 </method>
602 <method name="set_collapsed_recursive">
603 <return type="void" />
604 <param index="0" name="enable" type="bool" />
605 <description>
606 Collapses or uncollapses this [TreeItem] and all the descendants of this item.
607 </description>
608 </method>
609 <method name="set_custom_as_button">
610 <return type="void" />
611 <param index="0" name="column" type="int" />
612 <param index="1" name="enable" type="bool" />
613 <description>
614 Makes a cell with [constant CELL_MODE_CUSTOM] display as a non-flat button with a [StyleBox].
615 </description>
616 </method>
617 <method name="set_custom_bg_color">
618 <return type="void" />
619 <param index="0" name="column" type="int" />
620 <param index="1" name="color" type="Color" />
621 <param index="2" name="just_outline" type="bool" default="false" />
622 <description>
623 Sets the given column's custom background color and whether to just use it as an outline.
624 [b]Note:[/b] If a custom [StyleBox] is set, the background color will be drawn behind it.
625 </description>
626 </method>
627 <method name="set_custom_color">
628 <return type="void" />
629 <param index="0" name="column" type="int" />
630 <param index="1" name="color" type="Color" />
631 <description>
632 Sets the given column's custom color.
633 </description>
634 </method>
635 <method name="set_custom_draw" deprecated="Use [method TreeItem.set_custom_draw_callback] instead.">
636 <return type="void" />
637 <param index="0" name="column" type="int" />
638 <param index="1" name="object" type="Object" />
639 <param index="2" name="callback" type="StringName" />
640 <description>
641 Sets the given column's custom draw callback to the [param callback] method on [param object].
642 The method named [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
643 </description>
644 </method>
645 <method name="set_custom_draw_callback">
646 <return type="void" />
647 <param index="0" name="column" type="int" />
648 <param index="1" name="callback" type="Callable" />
649 <description>
650 Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. The cell has to be in [constant CELL_MODE_CUSTOM] to use this feature.
651 The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
652 </description>
653 </method>
654 <method name="set_custom_font">
655 <return type="void" />
656 <param index="0" name="column" type="int" />
657 <param index="1" name="font" type="Font" />
658 <description>
659 Sets custom font used to draw text in the given [param column].
660 </description>
661 </method>
662 <method name="set_custom_font_size">
663 <return type="void" />
664 <param index="0" name="column" type="int" />
665 <param index="1" name="font_size" type="int" />
666 <description>
667 Sets custom font size used to draw text in the given [param column].
668 </description>
669 </method>
670 <method name="set_custom_stylebox">
671 <return type="void" />
672 <param index="0" name="column" type="int" />
673 <param index="1" name="stylebox" type="StyleBox" />
674 <description>
675 Sets the given column's custom [StyleBox] used to draw the background.
676 [b]Note:[/b] If a custom background color is set, the [StyleBox] will be drawn in front of it.
677 </description>
678 </method>
679 <method name="set_description">
680 <return type="void" />
681 <param index="0" name="column" type="int" />
682 <param index="1" name="description" type="String" />
683 <description>
684 Sets the given column's description for assistive apps.
685 </description>
686 </method>
687 <method name="set_edit_multiline">
688 <return type="void" />
689 <param index="0" name="column" type="int" />
690 <param index="1" name="multiline" type="bool" />
691 <description>
692 If [param multiline] is [code]true[/code], the given [param column] is multiline editable.
693 [b]Note:[/b] This option only affects the type of control ([LineEdit] or [TextEdit]) that appears when editing the column. You can set multiline values with [method set_text] even if the column is not multiline editable.
694 </description>
695 </method>
696 <method name="set_editable">
697 <return type="void" />
698 <param index="0" name="column" type="int" />
699 <param index="1" name="enabled" type="bool" />
700 <description>
701 If [param enabled] is [code]true[/code], the given [param column] is editable.
702 </description>
703 </method>
704 <method name="set_expand_right">
705 <return type="void" />
706 <param index="0" name="column" type="int" />
707 <param index="1" name="enable" type="bool" />
708 <description>
709 If [param enable] is [code]true[/code], the given [param column] is expanded to the right.
710 </description>
711 </method>
712 <method name="set_icon">
713 <return type="void" />
714 <param index="0" name="column" type="int" />
715 <param index="1" name="texture" type="Texture2D" />
716 <description>
717 Sets the given cell's icon [Texture2D]. If the cell is in [constant CELL_MODE_ICON] mode, the icon is displayed in the center of the cell. Otherwise, the icon is displayed before the cell's text. [constant CELL_MODE_RANGE] does not display an icon.
718 </description>
719 </method>
720 <method name="set_icon_max_width">
721 <return type="void" />
722 <param index="0" name="column" type="int" />
723 <param index="1" name="width" type="int" />
724 <description>
725 Sets the maximum allowed width of the icon in the given [param column]. This limit is applied on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height is adjusted according to the icon's ratio.
726 </description>
727 </method>
728 <method name="set_icon_modulate">
729 <return type="void" />
730 <param index="0" name="column" type="int" />
731 <param index="1" name="modulate" type="Color" />
732 <description>
733 Modulates the given column's icon with [param modulate].
734 </description>
735 </method>
736 <method name="set_icon_overlay">
737 <return type="void" />
738 <param index="0" name="column" type="int" />
739 <param index="1" name="texture" type="Texture2D" />
740 <description>
741 Sets the given cell's icon overlay [Texture2D]. The cell has to be in [constant CELL_MODE_ICON] mode, and icon has to be set. Overlay is drawn on top of icon, in the bottom left corner.
742 </description>
743 </method>
744 <method name="set_icon_region">
745 <return type="void" />
746 <param index="0" name="column" type="int" />
747 <param index="1" name="region" type="Rect2" />
748 <description>
749 Sets the given column's icon's texture region.
750 </description>
751 </method>
752 <method name="set_indeterminate">
753 <return type="void" />
754 <param index="0" name="column" type="int" />
755 <param index="1" name="indeterminate" type="bool" />
756 <description>
757 If [param indeterminate] is [code]true[/code], the given [param column] is marked indeterminate.
758 [b]Note:[/b] If set [code]true[/code] from [code]false[/code], then column is cleared of checked status.
759 </description>
760 </method>
761 <method name="set_language">
762 <return type="void" />
763 <param index="0" name="column" type="int" />
764 <param index="1" name="language" type="String" />
765 <description>
766 Sets the language code of the given [param column]'s text to [param language]. This is used for line-breaking and text shaping algorithms. If [param language] is empty, the current locale is used.
767 </description>
768 </method>
769 <method name="set_metadata">
770 <return type="void" />
771 <param index="0" name="column" type="int" />
772 <param index="1" name="meta" type="Variant" />
773 <description>
774 Sets the metadata value for the given column, which can be retrieved later using [method get_metadata]. This can be used, for example, to store a reference to the original data.
775 </description>
776 </method>
777 <method name="set_range">
778 <return type="void" />
779 <param index="0" name="column" type="int" />
780 <param index="1" name="value" type="float" />
781 <description>
782 Sets the value of a [constant CELL_MODE_RANGE] column.
783 </description>
784 </method>
785 <method name="set_range_config">
786 <return type="void" />
787 <param index="0" name="column" type="int" />
788 <param index="1" name="min" type="float" />
789 <param index="2" name="max" type="float" />
790 <param index="3" name="step" type="float" />
791 <param index="4" name="expr" type="bool" default="false" />
792 <description>
793 Sets the range of accepted values for a column. The column must be in the [constant CELL_MODE_RANGE] mode.
794 If [param expr] is [code]true[/code], the edit mode slider will use an exponential scale as with [member Range.exp_edit].
795 </description>
796 </method>
797 <method name="set_selectable">
798 <return type="void" />
799 <param index="0" name="column" type="int" />
800 <param index="1" name="selectable" type="bool" />
801 <description>
802 If [param selectable] is [code]true[/code], the given [param column] is selectable.
803 </description>
804 </method>
805 <method name="set_structured_text_bidi_override">
806 <return type="void" />
807 <param index="0" name="column" type="int" />
808 <param index="1" name="parser" type="int" enum="TextServer.StructuredTextParser" />
809 <description>
810 Set BiDi algorithm override for the structured text. Has effect for cells that display text.
811 </description>
812 </method>
813 <method name="set_structured_text_bidi_override_options">
814 <return type="void" />
815 <param index="0" name="column" type="int" />
816 <param index="1" name="args" type="Array" />
817 <description>
818 Set additional options for BiDi override. Has effect for cells that display text.
819 </description>
820 </method>
821 <method name="set_suffix">
822 <return type="void" />
823 <param index="0" name="column" type="int" />
824 <param index="1" name="text" type="String" />
825 <description>
826 Sets a string to be shown after a column's value (for example, a unit abbreviation).
827 </description>
828 </method>
829 <method name="set_text">
830 <return type="void" />
831 <param index="0" name="column" type="int" />
832 <param index="1" name="text" type="String" />
833 <description>
834 Sets the given column's text value.
835 </description>
836 </method>
837 <method name="set_text_alignment">
838 <return type="void" />
839 <param index="0" name="column" type="int" />
840 <param index="1" name="text_alignment" type="int" enum="HorizontalAlignment" />
841 <description>
842 Sets the given column's text alignment to [param text_alignment].
843 </description>
844 </method>
845 <method name="set_text_direction">
846 <return type="void" />
847 <param index="0" name="column" type="int" />
848 <param index="1" name="direction" type="int" enum="Control.TextDirection" />
849 <description>
850 Sets item's text base writing direction.
851 </description>
852 </method>
853 <method name="set_text_overrun_behavior">
854 <return type="void" />
855 <param index="0" name="column" type="int" />
856 <param index="1" name="overrun_behavior" type="int" enum="TextServer.OverrunBehavior" />
857 <description>
858 Sets the clipping behavior when the text exceeds the item's bounding rectangle in the given [param column].
859 </description>
860 </method>
861 <method name="set_tooltip_text">
862 <return type="void" />
863 <param index="0" name="column" type="int" />
864 <param index="1" name="tooltip" type="String" />
865 <description>
866 Sets the given column's tooltip text.
867 </description>
868 </method>
869 <method name="uncollapse_tree">
870 <return type="void" />
871 <description>
872 Uncollapses all [TreeItem]s necessary to reveal this [TreeItem], i.e. all ancestor [TreeItem]s.
873 </description>
874 </method>
875 </methods>
876 <members>
877 <member name="collapsed" type="bool" setter="set_collapsed" getter="is_collapsed">
878 If [code]true[/code], the TreeItem is collapsed.
879 </member>
880 <member name="custom_minimum_height" type="int" setter="set_custom_minimum_height" getter="get_custom_minimum_height">
881 The custom minimum height.
882 </member>
883 <member name="disable_folding" type="bool" setter="set_disable_folding" getter="is_folding_disabled">
884 If [code]true[/code], folding is disabled for this TreeItem.
885 </member>
886 <member name="visible" type="bool" setter="set_visible" getter="is_visible">
887 If [code]true[/code], the [TreeItem] is visible (default).
888 Note that if a [TreeItem] is set to not be visible, none of its children will be visible either.
889 </member>
890 </members>
891 <constants>
892 <constant name="CELL_MODE_STRING" value="0" enum="TreeCellMode">
893 Cell shows a string label, optionally with an icon. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used.
894 </constant>
895 <constant name="CELL_MODE_CHECK" value="1" enum="TreeCellMode">
896 Cell shows a checkbox, optionally with text and an icon. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable.
897 </constant>
898 <constant name="CELL_MODE_RANGE" value="2" enum="TreeCellMode">
899 Cell shows a numeric range. When editable, it can be edited using a range slider. Use [method set_range] to set the value and [method set_range_config] to configure the range.
900 This cell can also be used in a text dropdown mode when you assign a text with [method set_text]. Separate options with a comma, e.g. [code]"Option1,Option2,Option3"[/code].
901 </constant>
902 <constant name="CELL_MODE_ICON" value="3" enum="TreeCellMode">
903 Cell shows an icon. It can't be edited nor display text. The icon is always centered within the cell.
904 </constant>
905 <constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode">
906 Cell shows as a clickable button. It will display an arrow similar to [OptionButton], but doesn't feature a dropdown (for that you can use [constant CELL_MODE_RANGE]). Clicking the button emits the [signal Tree.item_edited] signal. The button is flat by default, you can use [method set_custom_as_button] to display it with a [StyleBox].
907 This mode also supports custom drawing using [method set_custom_draw_callback].
908 </constant>
909 </constants>
910 </class>