3 /* Copyright Massachusetts Institute of Technology 1985 */
6 * XMenu: MIT Project Athena, X Window system menu package
8 * XMenuPost - Maps a given menu to the display and activates
9 * the menu for user selection. The user is allowed to
10 * specify the mouse button event mask that will be used
11 * to identify a selection request. When a selection
12 * request is received (i.e., when the specified mouse
13 * event occurs) the data returned will be either the
14 * data associated with the particular selection active
15 * at the time of the selection request or NULL if no
16 * selection was active. A menu selection is shown to
17 * be active by placing a highlight box around the
18 * selection as the mouse cursor enters its active
19 * region. Inactive selections will not be highlighted.
20 * As the mouse cursor moved from one menu pane
21 * to another menu pane the pane being entered is raised
22 * and activated and the pane being left is deactivated.
23 * If an error occurs NULL will be returned with the
24 * p_num set to POST_ERROR, s_num set to
25 * NO_SELECTION and _XMErrorCode set to an
27 * Every time the routine returns successfully the
28 * p_num and s_num indices will be set to indicate
29 * the currently active pane and/or selection. If the
30 * mouse was not in a selection window at the time
31 * s_num will be set to NO_SELECTION.
33 * Author: Tony Della Fera, DEC
41 XMenuPost(display
, menu
, p_num
, s_num
, x_pos
, y_pos
, event_mask
)
42 register Display
*display
; /* Previously opened display. */
43 register XMenu
*menu
; /* Menu to post. */
44 register int *p_num
; /* Pane number selected. */
45 register int *s_num
; /* Selection number selected. */
46 register int x_pos
; /* X coordinate of menu position. */
47 register int y_pos
; /* Y coordinate of menu position. */
48 int event_mask
; /* Mouse button event mask. */
50 register int stat
; /* Routine call return status. */
51 char *data
; /* Return data. */
54 * Set up initial pane and selection assumptions.
58 * Make the procedure call.
69 * Check the return value and return accordingly.
74 *s_num
= NO_SELECTION
;
78 *s_num
= NO_SELECTION
;
86 /* arch-tag: 7b6104e5-fa32-4342-aa17-05296a30dd70
87 (do not change this comment) */