Product Documentation
Virtuoso Layout Suite SKILL Reference
Product Version IC23.1, November 2023

mbRegisterMenuItem

mbRegisterMenuItem(
t_viewType
l_menuItemDef
t_enableCB
)
=> t_menuItemId / nil

Description

Registers a menu item with the menu builder that has been defined using the older menu creation syntax. mbSetContextData needs to be called before the menu item is visible.

Arguments

t_viewType

Name of the view type for which this action has been registered.

l_menuItemDef

List containing the old style menu definition. The list is specified in the following format:

<name> <menuText> <callBack>

t_enableCB

Function to determine if action is enabled or disabled.

Values Returned

t_menuItemId

ID of the menu item that is created and registered.

nil

Returned when registration of the menu fails.

Example

MyNewItem = '(NewItem "&New..." "deFileNew()")
mbRegisterMenuItem("maskLayout" MyNewItem "t")
mbSetContextData("maskLayout" "NewItem" "Shape" "Canvas" "Common")

Returns hiMenuItem@0x1cdaa020, t.

You can use symbolToString(car(MyNewItem)) to get the second argument for the function mbSetContextData().

Registers the menu item MyNewItem with the menu builder. mbSetContextData is called to make this menu item visible. Also, the unique ID of the menu item, NewItem is the first entry in the sublist passed as the second argument to mbRegisterMenuItem.


Return to top
 ⠀
X