home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / windows / x / motif / 7606 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.7 KB  |  48 lines

  1. Newsgroups: comp.windows.x.motif
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!kendal!dao
  3. From: dao@rchland.vnet.ibm.com (Dan Dao)
  4. Subject: Re: Problem with WM_DELETE_WINDOW callback
  5. Sender: news@rchland.ibm.com
  6. Message-ID: <1992Nov20.131405.16373@rchland.ibm.com>
  7. Date: Fri, 20 Nov 1992 13:14:05 GMT
  8. Distribution: comp
  9. Reply-To: dao@rchland.vnet.ibm.com
  10. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  11. References:  <1egprpINNmph@travis.csd.harris.com>
  12. Nntp-Posting-Host: kendal.rchland.ibm.com
  13. Organization: IBM Rochester
  14. Lines: 32
  15.  
  16. --
  17.  
  18. The code should read as follow:
  19.  
  20.   Atom         wmDeleteWindow ;
  21.   Widget       shell, new_window ;
  22.   [...]
  23.   shell      = XtCreatePopupShell("mywindow", 
  24.                                   topLevelShellWidgetClass, AppShell, 
  25.                                   args, argcnt) ;
  26.   new_window = CreatemyWindow(shell) ;    /* create and manage widgets */
  27.                XtManageChild(new_window) ;
  28.                XtPopup(shell, XtGrabNone) ;
  29.  
  30.                  /* I want to handle the wm Close item. */
  31.                XtVaSetValues(shell, XmNdeleteResponse, XmDO_NOTHING, NULL);
  32.  
  33.                  /* Set up my callback for this protocol. */
  34.                wmDeleteWindow = XmInternAtom(XtDisplay(shell),
  35.                                             "WM_DELETE_WINDOW",
  36.                                             False) ;
  37.                XmRemoveWMProtocols( shell, &wmDeleteWindow, 1 );
  38.                XmAddWMProtocolCallback(shell,
  39.                                        wmDeleteWindow,
  40.                                        (XtCallbackProc)myCloseCB,  
  41.                                        (caddr_t)new_window) ;
  42.  
  43.  
  44. Hope that help.
  45.  
  46. ---
  47. Dan Dao dao@rchland.vnet.ibm.com (507)253-8023
  48.