pyui.create_combo_box - pytha-3d-cad/pytha-lua-api GitHub Wiki
Create a combo box where the user can either select a predefined option from a list or enter a custom text. Use insert_control_item to populate the drop list with options and reset_content to clear both the text and drop list. Call set_control_selection or set_control_text to initialize the text that is displayed in the control.
pyui.create_combo_box(dialog, col_spec)
dialog:create_combo_box(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. |
text |
string |
Initial text content of the control |
Return value
| Type | Description |
|---|---|
control_handle |
A handle to the newly created control |
Events
When the user types text or changes the selected option in the drop list, the on_change handler is called on_change_handler(text, new_index) with one string argument of the current text and one integer argument for the index of the currently selected option (nil if the text does not match any option).
See also
Control Gallery, set_control_text, insert_control_item, reset_content, set_control_selection, set_on_change_handler, create_text_box, create_drop_list