Programming Guide |
Inserts a new item into a menu
int sm_mnitem_create(int mem_location, char *script, char *menu, int next_item_no, int item_type, char *item_name);int sm_n_mnitem_create(int mem_location, char *script, char *menu, char *next_item_name, int item_type, char *item_name);
mem_location
- The memory location of the item's menu, one of the following constants:
MNL_APPLIC
MNL_SCREEN
MNL_FIELDscript
- The name of a memory-resident script that contains the item's menu. The script must already be loaded into memory at
mem_location
by sm_mnscript_load. If you supplyNULL
, Panther searches in the most recently loaded script inmem_location
for the specified menu.menu
- The name of the item's menu, as listed in the Submenu field of the menu bar editor or with the
MENU
keyword in an ASCII menu file. If you supplyNULL
, Panther uses the first menu inscript
.next_item_no, next_item_name
- Specifies the new item's position by the number or name of the item to follow it:
sm_mnitem_create
identifies the next item by its numeric offset within the menu, where the first menu item is0
. Supply-1
to append the new item to the end of the menu.item_type
- The item's type. Supply one of the constants described in Table 5-16.
item_name
- The name to assign this item. Item names must be unique within the same menu. Supply
NULL
to create an unnamed item.
C only
sm_mnitem_create
inserts a new menu item into a menu. After you create this item, you can set its properties through sm_mnitem_change. The menu displays this item at the next delayed write.Table 5-16 lists menu item type constants.