AddCustomMenuItem

AddCustomMenuItem — a convenience method for creating a menu item.

Syntax

AddCustomMenuItem (label, code)
    

Arguments

label

The name of the item, as a text string, that will actually appear on the menu.

code

Any piece of code that should be run when the menu item is selected.

Returns

A list containing two members: the ID number for this action, followed by a Gamma expression that is the action to be taken when a menu item is selected.

Description

This method is a convenience method for adding a menu item. It is a wrapper on AddMenuItem. It creates an item for a menu created by AddCustomSubMenu, allowing any arbitrary code to be attached. This method can be used for modifying the application as it runs. Items to be created by this command must be coded immediately after AddCustomSubMenu, and will appear in sequence on that submenu.

Example

.AddCustomSubMenu("My Menu", 3);
.AddCustomMenuItem("My First Item, `princ("First Item Activated\n"));
.AddCustomMenuItem("My Second Item, `princ("Second Item Activated\n"));
.AddCustomMenuItem("My Third Item, `princ("Third Item Activated\n"));
...