Vizard 7 » Command Index » Vizard objects » node3d » <node3d:GUI:droplist>.getSelection
7.6

<node3d:GUI:droplist>.getSelection

Returns the index of the selected element.

<node3d:GUI:droplist>.getSelection()  

Remarks

This command will return the zero-based index of the currently selected item.

Return Value

The index of the selected element.

Example

droplist = viz.addDropList()
droplist.setPosition(.5,.5)
options = ['A','B','C','D']
droplist.addItems(options)
droplist.select(2)
print(droplist.getSelection()) #Returns 2