Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!alfalfa.com!nazgul From: nazgul@alfalfa.com (Information Junkie) Newsgroups: comp.windows.x.motif Subject: Re: Some tricky bits... Message-ID: <910403093012.1100@sun> Date: 3 Apr 91 14:30:12 GMT References: <2185@raybed2.msd.ray.com> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 24 > 1. How does one disable the f.close option in the window menu. I suspect > it's with a protocol, but can't figure it out. This surely must be in the FAQ by now. The answer is: You can disable the f.close option by setting the shell resource XmNdeleteResponse to XmDO_NOTHING. However, you should never just do this. Instead you should set this, and then set up a protocol handler so that your code is called to handle the close. Otherwise you'll end up with an irate user. To set up a handler... atoms[0] = XmInternAtom(XtDisplay(widget), "WM_DELETE_WINDOW", False); XmAddWMProtocols(widget, atoms, 1); XmAddWMProtocolCallback(widget, atoms[0], (XtCallbackProc)OmXWidgetDelete, (caddr_t)this); Alfalfa Software, Inc. | Poste: The EMail for Unix nazgul@alfalfa.com | Send Anything... Anywhere 617/646-7703 (voice/fax) | info@alfalfa.com I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.