-
Notifications
You must be signed in to change notification settings - Fork 18
pyui.create_list_box
Create a list box for the user to select one of multiple options. Use insert_control_item to populate the list box with options and reset_content to clear the list box. Call set_control_selection to initialize the selection status.
Note that radio buttons and drop lists are another way to present multiple options to the user.
pyui.create_list_box(dialog, col_spec)
dialog:create_list_box(col_spec)| 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. |
| Type | Description |
|---|---|
control_handle |
A handle to the newly created control |
The length of a list box is calculated from the number of adjacent rows. Fine-tuning of the length can be achieved by inserting alignments and empty elements.
When the user changes the selected option of a list box, 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.
Control Gallery, insert_control_item, set_control_selection, reset_content, set_on_change_handler, create_drop_list, create_radio_button, create_align, create_empty