MENU_GEN_PROC_ITEM
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_GEN_PULLRIGHT
Defines the generate procedure for the menu item’s submenu.
Argument: void (*menu_gen_proc)()
Default:
NULL
Procs: create, get, set
Objects: Menu_item
Callback:
Menu
menu_gen_proc(m, op)
Menu m;
Menu_generate op;
This menu generating procedure is called whenever a menu item has
MENU_GEN_PROC
set and the menu needs to be displayed or traversed. It should return a handle to a menu
that has either been dynamically created or statically stored.
See Also: 11.9
MENU_GEN_PULLRIGHT_IMAGE
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_GEN_PULLRIGHT_ITEM
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_IMAGE
Specifies the menu item’s server image.
Argument: Server_image
Default:
NULL
Procs: create, get, set
Objects: Menu_item
See Also: 11.6.1
MENU_IMAGE_ITEM
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_IMAGES
Creates menu items with the specified server images. The new menu items are appended to the menu.
Argument: list of Server_image
Default: None
Procs: create, set
Objects: Menu
See Also: 11.8
XView Attributes
XView Attributes 81
MENU_INACTIVE
If TRUE, the menu item is grayed out and not selectable.
Argument: Bool
Default:
FALSE
Procs: create, get, set
Objects: Menu_item
See Also: 11.13
MENU_INSERT
Inserts a new menu item after nth item in the menu.
Argument 1: int
Argument 2: Menu_item
Default: N/A
Procs: create, get, set
Objects: Menu
MENU_INSERT_ITEM
Inserts the menu item given as the next value after the menu item given as the first value.
Argument 1: Menu_item
Argument 2: Menu_item
Procs: create, set
Objects: Menu
MENU_ITEM
Allows you to create menu items in-line with the call to the xv_create() used to create your menu.
Takes a menu item-specific attribute-value list that would otherwise be used in a separate call to
xv_create() to create menu items with the
MENUITEM package.
Argument: A-V list
Procs: create, set
Objects: Menu
Usage:
xv_create(NULL, MENU,
MENU_ITEM,
MENU_STRING, "foo",
MENU_NOTIFY_PROC, foo_notify_proc,
NULL,
MENU_ITEM,
MENU_STRING, "bar",
MENU_NOTIFY_PROC, bar_notify_proc,
NULL,
NULL);
See Also: 11.6.1
MENU_LAST_EVENT
Gets the last event read by the menu. The event’s contents can be modified.
Return Type: Event *
Procs: get
Objects: Menu
See Also: 11.4
82 XView Reference Manual
MENU_NCOLS
Specifies the number of columns in a menu.
Argument: int
Default: 1
Procs: create, get, set
Objects: Menu
See Also: 11.11
MENU_NITEMS
Returns the number of items in a menu.
Return Type: int
Procs: get
Objects: Menu
See Also: 11.9
MENU_NOTIFY_PROC
Names a procedure to be called when the user selects a menu item.
Argument: void (*menu_notify_proc)()
Default:
NULL
Procs: create, get, set
Objects: Menu, Menu_item
Callback:
void
menu_notify_proc(menu, menu_item)
Menu menu;
Menu_item menu_item;
The notify procedure is attached to menus and menu items using
MENU_NOTIFY_PROC.
This function is called whenever the user selects a menu item. The menu identifies
which menu the menu_item belongs to.
See Also: 11.13
MENU_NOTIFY_STATUS
If the menu is attached to a menu button that is part of an unpinned pop-up window, then the window
is dismissed if
MENU_NOTIFY_STATUS is XV_OK. If MENU_NOTIFY_STATUS is set to XV_ERROR, then
the window is not dismissed. You probably will only need to xv_get() or xv_set() this attribute
from within a notify procedure. When a notify procedure exits for an unpinned command frame,
XView internally uses the value of this attribute to determine whether or not the command frame is
dismissed. XView sets the value of this attribute to
XV_OK before calling the notify procedure.
Argument: int
Default:
XV_OK
Valid Values: {XV_OK, XV_ERROR}
Procs: get, set
Objects: Menu
See Also: 11.16
XView Attributes
XView Attributes 83
MENU_NROWS
Sets or gets the number of rows in a menu.
Argument: int
Default: The number of menu items in the menu
Procs: create, get, set
Objects: Menu
See Also: 11.11
MENU_NTH_ITEM
Gets the nth menu item (n starts at 1).
Return Type: Menu_item
Argument: int
Procs: get
Objects: Menu
See Also: 11.9
MENU_PARENT
On a Menu object, this attribute is only valid from within a notify or generate procedure. With a sub-
menu the return value is the Menu Item from which the submenu was pulled-right. For a top-level
menu the xv_get() returns
NULL. On a Menu_item object, the return value is the handle of the en-
closing Menu.
Return Type: Menu or Menu_item
Procs: get
Objects: Menu, Menu_item
See Also: 11.9.1
MENU_PIN
Determines whether the menu will have pushpin.
Argument: Bool
Default:
FALSE
Procs: create, get, set
Objects: Menu
See Also: 11.12
MENU_PIN_PROC
Names a procedure called if a user chooses the pin menu item. The default procedure displays a win-
dow whose layout is similar to the menu it replaces.
Argument: void (*menu_pin_proc)()
Default: menu_default_pin_proc()
Procs: create, get, set
Objects: Menu
Callback:
void
menu_pin_proc(menu, x, y)
Menu menu;
int x, y;
This client-supplied procedure is called whenever the user attempts to pin-up a menu.
Attached to menus using the attribute, MENU_PIN_PROC. x and y are the fullscreen coor-
dinates of the upper-left corner of the pin window.
See Also: 11.12
84 XView Reference Manual
MENU_PIN_WINDOW
The handle of the command frame representing the pin window for the menu when pinned-up. Use
MENU_GEN_PIN_WINDOW to have XView manage this frame automatically. When using
MENU_GEN_PIN_WINDOW, the value returned by xv_get() for MENU_PIN_WINDOW will be NULL un-
til a menu is initially pinned.
Argument: Frame_cmd
Default: None
Procs: create, get, set
Objects: Menu
See Also: 11.12
MENU_PULLRIGHT
Item’s pullright menu.
Argument: Menu
Default:
NULL
Procs: create, get, set
Objects: Menu_item
See Also: 11.8
MENU_PULLRIGHT_IMAGE
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_PULLRIGHT_ITEM
This attribute is for SunView compatibility. For more information, refer to the manual Converting
SunView Applications.
MENU_RELEASE
Specifies that the menu item gets destroyed when its parent menu is destroyed. This is the default for
menu items created in-line.
Argument: No value
Default: Destroy item, if in-line; do not destroy item if Append or Replace.
Procs: create, set
Objects: Menu_item
See Also: 11.17
MENU_RELEASE_IMAGE
Specifies that the string or Server_image associated with the item is freed when the item is des-
troyed.
Argument: No value
Default: Do not release text string or server image.
Procs: create, set
Objects: Menu_item
See Also: 11.8
MENU_REMOVE
Removes the nth item from the menu ( n starts at 1).
Argument: int
Procs: set
Objects: Menu
See Also: 11.9
XView Attributes
XView Attributes 85
Get Volume 7B: XView Reference Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.