Picker

Choose a single item from a list of items.

Modulerequire("gui")
TypeClass
InheritsView

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

removeItemAt(index)

Remove the item at index.

Parameters

clear()

Remove all items.

getItems()

Return all items.

Return

Array

selectItemAt(index)

Select the item at index.

Parameters

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

Preventable

No.