3 /* Copyright Massachusetts Institute of Technology 1985 */
4 /* Copyright (C) 2002, 2003, 2004, 2005,
5 2006 Free Software Foundation, Inc. */
8 * XMenu: MIT Project Athena, X Window system menu package
10 * XMenuDeleteSelection - Deletes a selection from an XMenu object.
12 * Author: Tony Della Fera, DEC
20 XMenuDeleteSelection(display
, menu
, p_num
, s_num
)
21 register Display
*display
; /* Previously opened display. */
22 register XMenu
*menu
; /* Menu object to be modified. */
23 register int p_num
; /* Pane number to be deleted. */
24 register int s_num
; /* Selection number to be deleted. */
26 register XMPane
*p_ptr
; /* Pointer to pane being deleted. */
27 register XMSelect
*s_ptr
; /* Pointer to selections being deleted. */
30 * Find the right pane.
32 p_ptr
= _XMGetPanePtr(menu
, p_num
);
33 if (p_ptr
== NULL
) return(XM_FAILURE
);
36 * Find the right selection.
38 s_ptr
= _XMGetSelectionPtr(p_ptr
, s_num
);
39 if (s_ptr
== NULL
) return(XM_FAILURE
);
42 * Remove the selection from the association table.
44 XDeleteAssoc(display
, menu
->assoc_tab
, s_ptr
->window
);
47 * Remove the selection from the parent pane's selection
48 * list and update the selection count.
54 * Destroy the selection transparency.
56 if (s_ptr
->window
) XDestroyWindow(display
, s_ptr
->window
);
59 * Free the selection's XMSelect structure.
64 * Schedule a recompute.
69 * Return the selection number just deleted.
71 _XMErrorCode
= XME_NO_ERROR
;
75 /* arch-tag: 24ca2bc7-8a37-471a-8095-e6363fc1ed10
76 (do not change this comment) */