Picker
Choose a single item from a list of items.
| Module | require("yue.gui") |
| Type | Class |
| Inherits | View |
By default, the first item is automatically selected, and duplicate items are merged into one.
Class methods
create()
Create a new Picker view.
Return
PickerMethods
additem(title)
Add an item with title to the end.
Parameters
stringtitle
removeitemat(index)
Remove the item at index.
Parameters
integerindex
clear()
Remove all items.
getitems()
Return all items.
Return
tableselectitemat(index)
Select the item at index.
Parameters
integerindex
getselecteditem()
Return the title of selected item.
Empty string is returned if there is no selected item.
Return
stringgetselecteditemindex()
Return the index of selected item.
-1 is returned if there is no selected item.
Return
integerEvents
onselectionchange(self)
Emitted when user has changed the selected item.
Parameters
Pickerself