Picker
Choose a single item from a list of items.
Module | require("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
clear()
Remove all items.
getItems()
Return all items.
Return
Array
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