Class MenuItemSub

class ooodev.gui.menu.item.MenuItemSub(*, menu, data, owner, app='', lo_inst=None)[source]

Bases: MenuItem

Menu Item

Parameters:
__init__(*, menu, data, owner, app='', lo_inst=None)[source]

Constructor

Parameters:
  • data (Tuple[Tuple[PropertyValue, ...], ...]) – UNO Object containing menu item properties.

  • owner (IndexAccessComp) – Parent menu.

  • app (str | Service, optional) – Name LibreOffice module. Defaults to “”.

  • lo_inst (LoInst | None, optional) – Lo Instance. Defaults to Current Lo Instance.

  • menu (Menu) –

execute(in_thread=False)

Execute menu item

Return type:

bool

Parameters:

in_thread (bool) –

get_dispatch()

Get dispatch object.

If the menu item is disabled, this method will return None.

Return type:

DispatchComp | None

get_shortcuts()

Get shortcuts

Return type:

StrList

is_enabled()

Check if menu item is enabled

Return type:

bool

property app: str

Get app

Return type:

str

property command: str

Get/Set command

Return type:

str

property data: Tuple[Tuple[PropertyValue, ...], ...]

Get menu data

Return type:

Tuple[Tuple[PropertyValue, ...], ...]

property data_dict: Dict[str, Any]

Get menu data as dictionary

Return type:

Dict[str, Any]

property help_url: str

Get/Set help text

Return type:

str

property item_kind: MenuItemKind

Get item kind.

Returns:

MenuItemKind.ITEM_SUBMENU.

Return type:

MenuItemKind

Hint

  • MenuItemKind is an enum and can be imported from ooodev.gui.menu.item.menu_item_kind.

property label: str

Get/Set label

Return type:

str

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property menu: Menu

Get menu that owns this item.

Return type:

Menu

property menu_type: int

Get menu type.

Returns:

Menu type. 0 for MenuItem, 1 for MenuItemSep.

Return type:

int

property style: ItemStyleKind

Get/Set style

Hint

  • ItemStyleKind is an enum and can be imported from ooodev.utils.kind.item_style_kind.

Return type:

ItemStyleKind

property sub_menu: Menu

Get sub menu

Return type:

Menu