Skip to content

pyui.create_drop_list

fabian-flassig edited this page Jul 24, 2024 · 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 and reset_content to clear the drop list. Call set_control_selection to initialize the selection status.

Note that radio buttons and list boxes are other ways 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, reset_content, set_on_change_handler, create_radio_button, [list box](pyui.list box), create_combo_box

Clone this wiki locally