Create or replace a menu

The format of the <method> element for creating or replacing a menu is:

<method methodName="menu.createOrReplaceMenu">

Use this method to create a new menu or replace an existing one that can contain tools, submenus, and separators. The <method> element contains one or more <supermenu> elements. Each <supermenu> element contains any number of <separator>, <menu>, and <tool> elements that define the content of the menu. For more information, see <supermenu>.

Example

This example creates or replaces a menu named toolMenu2 and adds two tools to it.

<methodCall>
	<method methodName="menu.createOrReplaceMenu">
		<supermenu name="toolMenu2">
			<tool shortcut="" label="Ping" name="Ping" mnemonic="" />
			<tool shortcut="" label="commandTool1" name="commandTool1" mnemonic="" />
		</supermenu>
	<method>
</methodCall>