home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!tulane!uflorida!travis.csd.harris.com!cindy
- From: cindy@SSD.CSD.HARRIS.COM (Cindy Walters)
- Newsgroups: comp.windows.x.motif
- Subject: Problem with WM_DELETE_WINDOW callback
- Message-ID: <1egprpINNmph@travis.csd.harris.com>
- Date: 19 Nov 92 19:27:53 GMT
- Distribution: comp
- Organization: Harris Computers Systems Division, Fort Lauderdale,FL
- Lines: 50
- NNTP-Posting-Host: hcx1.ssd.csd.harris.com
-
-
- I am working on a Motif user interface to a large, multi-window
- application. I'm experiencing a problem when I try to handle the window
- manager (mwm) "Close" system menu item - I do not want the window to be
- immediately destroyed, rather I want to handle this situation in my own
- callback.
-
- I have been able to implement the behavior I want in a very simple, small
- Motif sample program which is very similar to the real application in the
- way it creates the various toplevel windows. However, when I transfer this
- code to my large application, it does not work :-( More specifically, I am
- able to get the window to "do nothing" when I select the mwm "Close" system
- menu, but the callback that I have set up for this protocol does not appear
- to be getting called when the "Close" system menu item is selected. Maybe
- someone can give me some suggestions on what to try? (I'm using X11R4 and
- Motif 1.1.4.)
-
- Please email, and I will summarize if there is interest. Thanks !
-
-
- Here's an example of the code I'm using:
- Atom wmDeleteWindow ;
- Widget shell, new_window ;
- [...]
- shell = XtCreatePopupShell("mywindow",
- topLevelShellWidgetClass, AppShell,
- args, argcnt) ;
- new_window = CreatemyWindow(shell) ; /* create and manage widgets */
- XtManageChild(new_window) ;
- XtPopup(shell, XtGrabNone) ;
-
- /* I want to handle the wm Close item. */
- XtVaSetValues(shell, XmNdeleteResponse, XmDO_NOTHING, NULL);
-
- /* Set up my callback for this protocol. */
- wmDeleteWindow = XmInternAtom(XtDisplay(shell),
- "WM_DELETE_WINDOW",
- False) ;
- XmAddWMProtocolCallback(shell,
- wmDeleteWindow,
- (XtCallbackProc)myCloseCB,
- (caddr_t)new_window) ;
-
- I have a 'printf()' statement in myCloseCB() to see if it ever gets that
- far, but it never does.
-
- Any ideas? Thanks for considering this :-)
-
- Cindy Walters
- cindy@ssd.csd.harris.com
-