1.5 KiB
1.5 KiB
Dropdowns are objects where the user can click on a button, this will open a list where the user can choose from.
Object methods also apply for dropdowns.
| addItem | Adds a new item into the list |
| removeItem | Removes a item from the list |
| editItem | Changes a already existing item in the list |
| getItem | Returns a item by its index |
| getItemCount | Returns the item count |
| getAll | Returns the entire list as a table |
| selectItem | Selects a item |
| clear | Makes the entire list empty |
| getItemIndex | Returns the currently active item index |
| setSelectedItem | Changes the default bg and fg, when the user selects a item |
| setOffset | Changes the list offset |
| getOffset | Returns the current offset |
| setDropdownSize | Changes the dropdown size |
A item-table in dropdowns looks like the following example:
item = {
text="1. Entry", -- the text its showing
bgCol=colors.black, -- the background color
fgCol=colors.white -- the foreground color
args = {} -- custom args you want to pass, which you will be able to access in for example onChange events
}