home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / motif / 8899 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.7 KB

  1. Path: sparky!uunet!ukma!darwin.sura.net!paladin.american.edu!howland.reston.ans.net!sol.ctr.columbia.edu!ursa!buzz
  2. From: buzz@bear.com (Buzz Moschetti)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: Killing Motif Aplications on Sun
  5. Message-ID: <BUZZ.93Jan28140420@lion.bear.com>
  6. Date: 28 Jan 93 19:04:20 GMT
  7. References: <1993Jan28.155552.4857@picker.com>
  8. Sender: news@bear.com
  9. Reply-To: buzz@bear.com (Buzz Moschetti)
  10. Distribution: na
  11. Organization: Bear, Stearns & Co. - FAST
  12. Lines: 40
  13. In-reply-to: kobet@xsun2a.ct.picker.com's message of 28 Jan 93 15:55:52 GMT
  14.  
  15. In article <1993Jan28.155552.4857@picker.com> kobet@xsun2a.ct.picker.com (Harry J Kobetitsch) writes:
  16.  
  17.    I am trying to kill a Motif application by double clicking on the
  18.    top leftmost button. 
  19.  
  20. What window manager is this, if that's the button you're double
  21. clicking?  Assuming it is a WM button we're talking about here, beware
  22. that some shells respond to the WM WM_DELETE hint by unmapping, not
  23. destroying the shell, in which case you've lost it.  Also, the 
  24. standard XtAppMainLoop() event loop does *not* return when there
  25. are no more resources with registered events, so even if you are good
  26. about destroying everything your app will still hang.
  27.  
  28. Advice:  
  29. 1.  Make sure the shell tries to destroy itself upon receiving WM_DELETE.
  30. 2.  Set up your own event loop as follows:
  31.  
  32.     active_flag = 1;
  33.  
  34.     while(active_flag) {
  35.           XtAppNextEvent(UxAppContext, &ev);
  36.           XtDispatchEvent(&ev);
  37.     }
  38.  
  39. 3.  Add a destroy callback to shell widget that does this:
  40.  
  41.     void
  42.     destroy_cbk(w, clientdata, callbackdata)
  43.     Widget w;
  44.     XtPointer clientdata;
  45.     XtPointer callbackdata;
  46.     {
  47.           /* This will stop the loop in main()... */
  48.           active_flag = 0;
  49.     }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.