WMENU_ITEM(3W)
NAME
wmenu_item − specify or change a menu item
SYNOPSIS
#include <window.h>
int wmenu_item (fd, menuid, itemno, type, disp_sel, type_struct)
int fd;
int menuid;
int itemno;
int type;
int disp_sel;
char *type_struct;
DESCRIPTION
fd is a file descriptor for an opened window type device interface.
menuid
id of the menu to which an item will be added or changed.
itemno
id of the item to be affected or MENU_NEWITEM, see window.h, which establishes a new item within the menu.
type determines what type this item will be, valid values include, MENU_STRING and MENU_SEPARATOR, see window.h for a complete list.
disp_sel
Sets the select, display, and tracking attributes of this item. Selection attributes are MENU_NOTSELECTABLE or MENU_SELECTABLE. Display attributes are MENU_DISPNORM or MENU_DISPGREY. Track attributes are MENU_TRACKNOCHNG or MENU_TRACKINV. see window.h for a complete list.
type_struct
This is the data associated with the type. For MENU_STRING pass the text string to be displayed. For MENU_SEPARATOR pass a single character whose ordinal value is the thickness of the separator line.
For example, if you pass a space (’ ’) character as this parameter, and the type is MENU_SEPARATOR, then the thickness of the line will be 32 pixels (because an ASCII space character is 32 in decimal).
Note that values of 0 or less default to a thickness of two. For example, if you pass a null string (”), then the separator thickness defaults to 2 pixels.
DISCUSSION
This routine changes or adds an item to the specified menu. It returns as its value the id of the item.
SEE ALSO
wmenu_activate(3W), wmenu_create(3W), wmenu_delete(3W), wmenu_eventread(3W).
DIAGNOSTICS
If either of the following occur, -1 is returned; otherwise 0 is returned:
∗ fd, menuid, itemno, or type is invalid
∗ there is no room for the item. See errno(2) for further details.
Hewlett-Packard Company — HP-UX Release 8.0: January 1991