OptionsButton

class omni.kit.widget.options_button.OptionsButton(option_items: ~typing.List[~omni.kit.widget.options_menu.option_item.OptionItem], width: ~omni.ui._ui.Length = 24.000000px, height: ~omni.ui._ui.Length = 24.000000px, hide_on_click: bool = False, menu_width: ~omni.ui._ui.Length = 1.000000fr, style: ~typing.Dict = {})

Bases: object

A button that includes a popup menu for options.

Parameters
  • option_items (List[OptionItem]) – Option items.

  • width (ui.Length) – Button width. Default ui.Pixel(24).

  • height (ui.Length) – Button height. Default ui.Pixel(24).

  • hide_on_click (bool) – Hide popup menu if menu item clicked. Default False.

  • menu_width (ui.Length) – Width of popup menu item. Default ui.Fraction(1).

  • style (dict) – External widget style. Default empty.

Methods

__init__(option_items[, width, height, ...])

Constructor for OptionsButton.

destroy()

Clears models and destroys the options menu.

Attributes

button

Gets the ui.Button used as the options button.

model

Gets the OptionsModel associated with the button.

__init__(option_items: ~typing.List[~omni.kit.widget.options_menu.option_item.OptionItem], width: ~omni.ui._ui.Length = 24.000000px, height: ~omni.ui._ui.Length = 24.000000px, hide_on_click: bool = False, menu_width: ~omni.ui._ui.Length = 1.000000fr, style: ~typing.Dict = {})

Constructor for OptionsButton.

destroy() None

Clears models and destroys the options menu.

property button: Button

Gets the ui.Button used as the options button.

Returns

The button widget.

Return type

ui.Button

property model: OptionsModel

Gets the OptionsModel associated with the button.

Returns

The model used for options.

Return type

OptionsModel