(after-setting-font-hook): Rename hooks -> hook.
[emacs.git] / oldXMenu / DelSel.c
blob9f520860df803e06b90eecccb87cad84abfbc399
1 #include "copyright.h"
3 /* $Header: /u/src/emacs/19.0/oldXMenu/RCS/DelSel.c,v 1.1 1992/04/11 22:10:18 jimb Exp $ */
4 /* Copyright Massachusetts Institute of Technology 1985 */
6 /*
7 * XMenu: MIT Project Athena, X Window system menu package
9 * XMenuDeleteSelection - Deletes a selection from an XMenu object.
11 * Author: Tony Della Fera, DEC
12 * 20-Nov-85
16 #include "XMenuInt.h"
18 int
19 XMenuDeleteSelection(display, menu, p_num, s_num)
20 register Display *display; /* Previously opened display. */
21 register XMenu *menu; /* Menu object to be modified. */
22 register int p_num; /* Pane number to be deleted. */
23 register int s_num; /* Selection number to be deleted. */
25 register XMPane *p_ptr; /* Pointer to pane being deleted. */
26 register XMSelect *s_ptr; /* Pointer to selections being deleted. */
29 * Find the right pane.
31 p_ptr = _XMGetPanePtr(menu, p_num);
32 if (p_ptr == NULL) return(XM_FAILURE);
35 * Find the right selection.
37 s_ptr = _XMGetSelectionPtr(p_ptr, s_num);
38 if (s_ptr == NULL) return(XM_FAILURE);
41 * Remove the selection from the association table.
43 XDeleteAssoc(display, menu->assoc_tab, s_ptr->window);
46 * Remove the selection from the parent pane's selection
47 * list and update the selection count.
49 emacs_remque(s_ptr);
50 p_ptr->s_count--;
53 * Destroy the selection transparency.
55 if (s_ptr->window) XDestroyWindow(display, s_ptr->window);
58 * Free the selection's XMSelect structure.
60 free(s_ptr);
63 * Schedule a recompute.
65 menu->recompute = 1;
68 * Return the selection number just deleted.
70 _XMErrorCode = XME_NO_ERROR;
71 return(s_num);