MenuItem.Callback

Description

Sets or returns the name of the callback function for this menu item as a String. The callback function is called when the item is selected and is executed as a single undo event by Softimage. You can always undo/redo the action of a menu item callback function provided the function calls undoable commands and/or object model methods.

The callback function must be implemented in the plug-in's file as described in Definition Callbacks for Menus. If your menu is attached to a contextual menu, the currently selected objects are passed in to your callback. The target object under the cursor is also passed in as part of the selected objects. However, if no objects are selected, then only the target is passed in. The objects can be retrieved through the Context.GetAttribute method with "Target" specified as the value for the AttributeName parameter.

The menu item that points to a callback has the following caption: item_name [origin]

...where 'item_name' = the name of the menu item and 'origin' = the origin of the callback ([u] for user, [w] for workgroup).

C# Syntax

// get accessor
String rtn = MenuItem.Callback;
// set accessor
MenuItem.Callback = String;

See Also

Menu Menu.AddCallbackItem MenuItem.Command