3 /* Copyright Massachusetts Institute of Technology 1985 */
4 /* Copyright (C) 2001, 2002, 2003, 2004, 2005,
5 2006 Free Software Foundation, Inc. */
8 * XMenu: MIT Project Athena, X Window system menu package
10 * XMenuDestroy - Free all resources associated with and XMenu.
12 * Author: Tony Della Fera, DEC
19 XMenuDestroy(display
, menu
)
21 register XMenu
*menu
; /* Menu object to destroy. */
23 register XMPane
*p_ptr
; /* Pointer to the current pane. */
24 register XMPane
*p_next
; /* Pointer to the next pane. */
25 register XMSelect
*s_ptr
; /* Pointer to the current selection. */
26 register XMSelect
*s_next
; /* Pointer to the next selection. */
29 * Destroy the selection and pane X windows and free
30 * their corresponding XMWindows.
33 p_ptr
= menu
->p_list
->next
;
34 p_ptr
!= menu
->p_list
;
38 s_ptr
= p_ptr
->s_list
->next
;
39 s_ptr
!= p_ptr
->s_list
;
46 XDestroySubwindows(display
, p_ptr
->window
);
47 XDestroyWindow(display
, p_ptr
->window
);
54 * Destroy the association table.
56 XDestroyAssocTable(menu
->assoc_tab
);
59 * Free the mouse cursor.
61 XFreeCursor(display
, menu
->mouse_cursor
);
66 XFreeFont(display
, menu
->p_fnt_info
);
67 XFreeFont(display
, menu
->s_fnt_info
);
72 /* XFreePixmap(display, menu->p_bdr_pixmap);
73 XFreePixmap(display, menu->s_bdr_pixmap);
74 XFreePixmap(display, menu->p_frg_pixmap);
75 XFreePixmap(display, menu->s_frg_pixmap);
76 XFreePixmap(display, menu->bkgnd_pixmap); */
77 XFreePixmap(display
, menu
->inact_pixmap
);
80 * Free the color cells.
82 if ((menu
->p_bdr_color
!= BlackPixel(display
, DefaultScreen(display
))) && (menu
->p_bdr_color
!= WhitePixel(display
, DefaultScreen(display
))))
85 DefaultColormap(display
, DefaultScreen(display
)),
88 if ((menu
->s_bdr_color
!= BlackPixel(display
, DefaultScreen(display
))) && (menu
->s_bdr_color
!= WhitePixel(display
, DefaultScreen(display
))))
91 DefaultColormap(display
, DefaultScreen(display
)),
94 if ((menu
->p_frg_color
!= BlackPixel(display
, DefaultScreen(display
))) && (menu
->p_frg_color
!= WhitePixel(display
, DefaultScreen(display
))))
97 DefaultColormap(display
, DefaultScreen(display
)),
100 if ((menu
->s_frg_color
!= BlackPixel(display
, DefaultScreen(display
))) && (menu
->s_frg_color
!= WhitePixel(display
, DefaultScreen(display
))))
103 DefaultColormap(display
, DefaultScreen(display
)),
106 if ((menu
->bkgnd_color
!= BlackPixel(display
, DefaultScreen(display
))) && (menu
->bkgnd_color
!= WhitePixel(display
, DefaultScreen(display
))))
109 DefaultColormap(display
, DefaultScreen(display
)),
119 /* arch-tag: 44c9589f-5893-46fc-bc23-1b03a7f9c015
120 (do not change this comment) */