Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!sdd.hp.com!hp-pcd!hpcvlx!gabe From: gabe@hpcvlx.cv.hp.com (Gabe Begeddov) Newsgroups: comp.windows.x.motif Subject: Re: Catching an exit event Message-ID: <110630001@hpcvlx.cv.hp.com> Date: 9 Jul 90 22:39:21 GMT References: <1990Jul9.154749.29605@maytag.waterloo.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 33 / hpcvlx:comp.windows.x.motif / giguere@csg.UWaterloo.CA (Eric Giguere) / 8:47 am Jul 9, 1990 / Pardon me if this is a stupid question: How can I tell under Motif/X when a user has selected the "Close" item on the system menu attached to the top-level shell? As far as I can tell a ClientMessage gets generated and then the application exits. All fine and dandy, but I need to intercept that message so that I can perform my own exit calls before letting Motif continue -- or after, actually. Do I need to add some kind of event handler for XtDispatchEvent to call? VendorShell exports a resource (XmNdeleteResponse) that controls the built-in response to the message. In addition, a set of interfaces is exported that allows you to add a "callback" that is invoked for a specific inter-client protocol. In this case the "WM_DELETE_WINDOW" protocol. Check the syntax in the programmer's guide (I think ch 8) which should be something like: XmAddWMProtocolCallback(shell, delete_window_atom, callback, c_data) While I'm at it: we're running Motif on top of XR4. The docs say Motif was designed to work with R3. Am I going to run into any major difficulties? As long as you use the client side libraries for Motif (Xm, Xt). You may get some warnings from an R4 Xlib. You may also need to run your r4 server in backwards compatability mode to get around some paned window funnies. -- Eric Giguere giguere@csg.UWaterloo.CA ---------- Gabe Beged-Dov ++++++++++++++++ HP Motif Team Corvallis,Oregon