Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
ItemList¶
Inherits: Control < CanvasItem < Node < Object
A vertical list of selectable items with one or multiple columns.
Description¶
This control provides a vertical list of selectable items that may be in a single or in multiple columns, with each item having options for text and an icon. Tooltips are supported and may be different for every item in the list.
Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter.
Item text only supports single-line strings. Newline characters (e.g. \n
) in the string won't produce a newline. Text wrapping is enabled in ICON_MODE_TOP mode, but the column's width is adjusted to fully fit its content by default. You need to set fixed_column_width greater than zero to wrap the text.
All set_*
methods allow negative item indices, i.e. -1
to access the last item, -2
to select the second-to-last item, and so on.
Incremental search: Like PopupMenu and Tree, ItemList supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing ProjectSettings.gui/timers/incremental_search_max_interval_msec.
Properties¶
|
||
|
||
|
||
|
||
clip_contents |
|
|
|
||
|
||
focus_mode |
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
Theme Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Signals¶
empty_clicked ( Vector2 at_position, int mouse_button_index )
Triggered when any mouse click is issued within the rect of the list but on empty space.
item_activated ( int index )
Triggered when specified list item is activated via double-clicking or by pressing Enter.
item_clicked ( int index, Vector2 at_position, int mouse_button_index )
Triggered when specified list item has been clicked with any mouse button.
The click position is also provided to allow appropriate popup of context menus at the correct location.
item_selected ( int index )
Triggered when specified item has been selected.
allow_reselect must be enabled to reselect an item.
multi_selected ( int index, bool selected )
Triggered when a multiple selection is altered on a list allowing multiple selection.
Enumerations¶
enum IconMode:
IconMode ICON_MODE_TOP = 0
Icon is drawn above the text.
IconMode ICON_MODE_LEFT = 1
Icon is drawn to the left of the text.
enum SelectMode:
SelectMode SELECT_SINGLE = 0
Only allow selecting a single item.
SelectMode SELECT_MULTI = 1
Allows selecting multiple items by holding Ctrl or Shift.
Property Descriptions¶
bool allow_reselect = false
If