Programming Guide |
Gets a menu item's property
int sm_mnitem_get_int(int mem_location, char *script, char *menu, int item_no, int prop);int sm_n_mnitem_get_int(int mem_location, char *script, char *menu, char *item_name, int prop);char *sm_mnitem_get_str(int mem_location, char *script, char *menu, int item_no, int prop);char *sm_n_mnitem_get_str(int mem_location, char *script, char *menu, char *item_name, int prop);
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.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.item_no, item_name
- Specifies the menu item by its number or name:
sm_mnitem_get
identifies the item by its numeric offset within the menu, where the first menu item is0
.prop
- The property to get. Supply one of the constants described in Table 5-17.
- · The property's current value, returned either as an integer or as a pointer to a string value. Because this function stores a returned string in a pool of buffers that it shares with other functions, copy or process this data immediately.
NULL
Error returned by_get_str
variants. Call sm_menu_bar_error to get the error code.
- -1 Error returned by
_get_int
variants. Call sm_menu_bar_error to get the error code.
sm_mnitem_get_int
andsm_mnitem_get_str
return the current setting of the specified property. Use the_int
variant for those properties that have an integer value—for example,MNI_SEP_STYLE
; use the_str
variant for properties that take string values, such asMNI_NAME
andMNI_ACCEL
.Table 5-17 lists the menu item property constants that you can supply as arguments to the
prop
parameter and the values that these return. Integer and string properties are listed in separate groups.