home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!darwin.sura.net!paladin.american.edu!howland.reston.ans.net!sol.ctr.columbia.edu!ursa!buzz
- From: buzz@bear.com (Buzz Moschetti)
- Newsgroups: comp.windows.x.motif
- Subject: Re: Killing Motif Aplications on Sun
- Message-ID: <BUZZ.93Jan28140420@lion.bear.com>
- Date: 28 Jan 93 19:04:20 GMT
- References: <1993Jan28.155552.4857@picker.com>
- Sender: news@bear.com
- Reply-To: buzz@bear.com (Buzz Moschetti)
- Distribution: na
- Organization: Bear, Stearns & Co. - FAST
- Lines: 40
- In-reply-to: kobet@xsun2a.ct.picker.com's message of 28 Jan 93 15:55:52 GMT
-
- In article <1993Jan28.155552.4857@picker.com> kobet@xsun2a.ct.picker.com (Harry J Kobetitsch) writes:
-
- I am trying to kill a Motif application by double clicking on the
- top leftmost button.
-
- What window manager is this, if that's the button you're double
- clicking? Assuming it is a WM button we're talking about here, beware
- that some shells respond to the WM WM_DELETE hint by unmapping, not
- destroying the shell, in which case you've lost it. Also, the
- standard XtAppMainLoop() event loop does *not* return when there
- are no more resources with registered events, so even if you are good
- about destroying everything your app will still hang.
-
- Advice:
- 1. Make sure the shell tries to destroy itself upon receiving WM_DELETE.
- 2. Set up your own event loop as follows:
-
- active_flag = 1;
-
- while(active_flag) {
- XtAppNextEvent(UxAppContext, &ev);
- XtDispatchEvent(&ev);
- }
-
- 3. Add a destroy callback to shell widget that does this:
-
- void
- destroy_cbk(w, clientdata, callbackdata)
- Widget w;
- XtPointer clientdata;
- XtPointer callbackdata;
- {
- /* This will stop the loop in main()... */
- active_flag = 0;
- }
-
-
-
-
-
-