Skip to content

pyui.create_drop_list

daniel-flassig edited this page May 3, 2020 · 10 revisions

Create a drop-down list for the user to select one of multiple options. Use insert_control_item to populate the drop list with options. Call set_control_selection to initialize the selection status.

Note that radio buttons are another way to present multiple options to the user. They require more space but are also more easily accessible.

pyui.create_drop_list(dialog, col_spec)
dialog:create_drop_list(col_spec)

Parameters

Type Description
dialog dialog_handle Dialog where the control is created
col_spec integer or {first, last} Index of the column or specification of the column-span, where the control is placed.

Return value

Type Description
control_handle A handle to the newly created control

Events

When the user changes the selected option of a drop list, the on_change handler is called on_change_handler(text, new_index) with one string argument of the selected text and one integer argument for the index of the newly selected option.

See also

Control Gallery, insert_control_item, set_control_selection, set_on_click_handler, create_radio_button, create_check_box, create_drop_list

Clone this wiki locally