3 /* Copyright Massachusetts Institute of Technology 1985 */
6 * XMenu: MIT Project Athena, X Window system menu package
8 * XMenuDeleteSelection - Deletes a selection from an XMenu object.
10 * Author: Tony Della Fera, DEC
18 XMenuDeleteSelection(display
, menu
, p_num
, s_num
)
19 register Display
*display
; /* Previously opened display. */
20 register XMenu
*menu
; /* Menu object to be modified. */
21 register int p_num
; /* Pane number to be deleted. */
22 register int s_num
; /* Selection number to be deleted. */
24 register XMPane
*p_ptr
; /* Pointer to pane being deleted. */
25 register XMSelect
*s_ptr
; /* Pointer to selections being deleted. */
28 * Find the right pane.
30 p_ptr
= _XMGetPanePtr(menu
, p_num
);
31 if (p_ptr
== NULL
) return(XM_FAILURE
);
34 * Find the right selection.
36 s_ptr
= _XMGetSelectionPtr(p_ptr
, s_num
);
37 if (s_ptr
== NULL
) return(XM_FAILURE
);
40 * Remove the selection from the association table.
42 XDeleteAssoc(display
, menu
->assoc_tab
, s_ptr
->window
);
45 * Remove the selection from the parent pane's selection
46 * list and update the selection count.
52 * Destroy the selection transparency.
54 if (s_ptr
->window
) XDestroyWindow(display
, s_ptr
->window
);
57 * Free the selection's XMSelect structure.
62 * Schedule a recompute.
67 * Return the selection number just deleted.
69 _XMErrorCode
= XME_NO_ERROR
;
73 /* arch-tag: 24ca2bc7-8a37-471a-8095-e6363fc1ed10
74 (do not change this comment) */