ComboBoxModel#

class omni.kit.viewport.menubar.core.ComboBoxModel(
texts: List[str],
values: List[Any] | None = None,
current_value: Any = None,
)#

Bases: AbstractItemModel

A data model for items in combobox drop list.

Methods

__init__(texts[, values, current_value])

Constructor.

destroy()

Release resources

get_item_children(item)

Returns all the children when the widget asks it.

get_item_value_model(item, column_id)

Retrieve item value model.

on_current_changed()

Callback when current selection in combobox changed

__init__(
texts: List[str],
values: List[Any] | None = None,
current_value: Any = None,
)#

Constructor.

Parameters:

texts (List[str]) – Texts displayed in combobox

Keyword Arguments:
  • values (Optional[List[Any]]) – Values for combobox list, default to None to use text as value

  • current_value (Any) – Current value displayed in combobox, defaults to None to use first one.

destroy() None#

Release resources

get_item_children(
item: ComboBoxItem | None,
) List[ComboBoxItem]#

Returns all the children when the widget asks it.

Parameters:

item (Optional[ComboBoxItem]) – Parent itemd, defaults to None means to retrieve root items.

get_item_value_model(
item: ComboBoxItem | None,
column_id: int,
)#

Retrieve item value model.

Parameters:
  • item (Optional[ComboBoxItem]) – Combobox item.

  • column_id (int) – Column index.

on_current_changed()#

Callback when current selection in combobox changed