home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!destroyer!ncar!noao!arizona!azhao
- From: azhao@cs.arizona.edu (Qiang Alex Zhao)
- Newsgroups: comp.windows.x
- Subject: Help -- set/get WM_DELETE_WINDOW
- Keywords: WM_DELETE_WINDOW
- Message-ID: <20689@optima.cs.arizona.edu>
- Date: 18 Aug 92 07:09:56 GMT
- Sender: news@cs.arizona.edu
- Followup-To: comp.windows.x
- Organization: Computer Science Dept, Univ of Arizona, Tucson
- Lines: 49
-
-
- Hi,
-
- I tried to use WM_DELETE_WINDOW, hoping to let my program know when a
- window is going to be killed. But my code didn't work with twm (Sun,
- X11R5), mwm, 4Dwm (SGI/Iris, X11R4).
-
- Here's my code:
-
- ....
- Atom delw;
- ....
- delw = XInternAtom(display, "WM_DELETE_WINDOW", False);
- XSetWMProtocols(display, window, &delw, 1);
- ....
- /* event-handling loop ... get event in variable ev */
- switch (ev.type) {
- ....
- case ClientMessage:
- printf("Got it!\n");
- /* free/destroy everything and close display */
- break;
- ....
- }
- ....
-
- My program just opened a window, "xprop" showed:
-
- WM_STATE(WM_STATE):
- window state: Normal
- icon window: 0x0
- WM_ICON_NAME(STRING) = "Test"
- WM_NAME(STRING) = "Test"
- WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
- ....
-
- Then I selected window menu (mwm) "Quit" or "Exit" -- nothing happened
- to that window, and the program still ran happily.
-
- What should I do? I saw some articles on this issue posted some weeks
- ago -- could anybody send me copies of those articles, or even better,
- a summery?
-
- Thanks a lot.
-
- ________________________________________________________________
- = Qiang Alex Zhao Computer Science Department
- azhao@cs.arizona.edu University of Arizona
- (602) 621-2759 Tucson, AZ 85721
-