AddItem (Menu)

Description

Adds a menu item at to end of the menu.

The most common use of this method is to add a submenu, onto which further MenuItems can be attached. This is useful for grouping similar actions together when there are many options in the menu.

Note: To add a MenuItem that invokes a command or callback it is better to use Menu.AddCommandItem or Menu.AddCallbackItem.

Tip: See the C++ API and Python examples for creating a Simple Menu plug-in to see this method in action.

Scripting Syntax

Menu.AddItem( Label, Style )

C# Syntax

MenuItem Menu.AddItem( String in_pLabel, siMenuItemStyle in_style );

Parameters

Parameter

Type

Description

Label

String

The menu item label.

Style

siMenuItemStyle

The menu item style, for example siMenuItemSubmenu.

Return Value

If the style is siMenuItemSubmenu the newly created Menu is returned. Otherwise the newly created MenuItem is returned.

See Also

MenuItem

Menu.AddSeparatorItem

Menu.AddCommandItem

Menu.AddCallbackItem

Definition Callbacks for Menus

Simple Menu plug-in example

 

 



Autodesk Softimage v7.5