ComboBoxMenuDelegate#

class omni.kit.viewport.menubar.core.ComboBoxMenuDelegate(
model: ComboBoxModel | None = None,
height: Length = 0,
width: Length = 300,
enabled: bool = True,
text: bool = True,
icon_name: str | None = None,
icon_width: Length = 30,
icon_height: Length = 30,
tooltip: str | None = None,
use_in_menubar: bool = False,
has_reset: bool = False,
)#

Bases: AbstractWidgetMenuDelegate

A menu delegate that creates combobox within a viewport menubar.

Methods

__init__([model, height, width, enabled, ...])

Constructor.

build_widget(item)

Build combobox with optional icon and label.

destroy()

Release resources.

Attributes

__init__(
model: ComboBoxModel | None = None,
height: Length = 0,
width: Length = 300,
enabled: bool = True,
text: bool = True,
icon_name: str | None = None,
icon_width: Length = 30,
icon_height: Length = 30,
tooltip: str | None = None,
use_in_menubar: bool = False,
has_reset: bool = False,
)#

Constructor.

Keyword Arguments:
  • model (Optional[ComboBoxModel]) – Combobox data model, defaults to None.

  • height (ui.Length) – Delegate height, defaults to 0 means auto height.

  • width (ui.Length) – Delegate width, defaults to 300 pixels.

  • enabled (bool) – Delegate enabled state, defaults to True.

  • text (bool) – Show text before combobox, defaults to True.

  • icon_name (Optional[str]) – Name of additional icon to be displayed before text, defaults to None means no additional icon.

  • icon_width (ui.Length) – Width of additional icon. Only available when icon_name is valid, defaults to 30 pixels.

  • icon_height (ui.Length) – Height of additional icon. Only available when icon_name is valid, defaults to 30 pixels.

  • tooltip (Optional[str]) – Delegate tooltip, defaults to None means no tooltip.

  • use_in_menubar (bool) – Show delegate in menu bar, defaults to False.

  • has_reset (bool) – Show reset button, defaults to False.

build_widget(
item: MenuHelper,
) None#

Build combobox with optional icon and label.

Parameters:

item (ui.MenuHelper) – Menu item.

destroy() None#

Release resources.