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
Picker
Methods
additem(title)
Add an item with title
to the end.
Parameters
string
title
removeitemat(index)
Remove the item at index
.
Parameters
integer
index
getitems()
Return all items.
Return
table
selectitemat(index)
Select the item at index
.
Parameters
integer
index
getselecteditem()
Return the title of selected item.
Empty string is returned if there is no selected item.
Return
string
getselecteditemindex()
Return the index of selected item.
-1 is returned if there is no selected item.
Return
integer
Events
onselectionchange(self)
Emitted when user has changed the selected item.
Parameters
Picker
self