home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!kendal!dao
- From: dao@rchland.vnet.ibm.com (Dan Dao)
- Subject: Re: Problem with WM_DELETE_WINDOW callback
- Sender: news@rchland.ibm.com
- Message-ID: <1992Nov20.131405.16373@rchland.ibm.com>
- Date: Fri, 20 Nov 1992 13:14:05 GMT
- Distribution: comp
- Reply-To: dao@rchland.vnet.ibm.com
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <1egprpINNmph@travis.csd.harris.com>
- Nntp-Posting-Host: kendal.rchland.ibm.com
- Organization: IBM Rochester
- Lines: 32
-
- --
-
- The code should read as follow:
-
- 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) ;
- XmRemoveWMProtocols( shell, &wmDeleteWindow, 1 );
- XmAddWMProtocolCallback(shell,
- wmDeleteWindow,
- (XtCallbackProc)myCloseCB,
- (caddr_t)new_window) ;
-
-
- Hope that help.
-
- ---
- Dan Dao dao@rchland.vnet.ibm.com (507)253-8023
-