[comp.windows.x.motif] How do I kill the window menu?

gat@gator.cacs.usl.edu (Gary Thompson) (07/31/90)

In article <11442@paperboy.OSF.ORG> dbrooks@osf.org (David Brooks) writes:
>In article <863@airgun.wg.waii.com> lampshir@airgun.wg.waii.com (gregory
>> [ text deleted ]
>
>As has been pointed out, you can't do this programatically unless you
>have patch release 1.0.3.  But you can do it using resources:
>
>	Mwm*clientDecoration: -menu
>
>If, however, you want to stop the user killing the client from the
>window menu, remember "shift-esc" and Btn3Down in frame will also bring
>the menu up.  The safe way of suppressing that is via the protocol stuff.
>-- 
>David Brooks				dbrooks@osf.org
>Systems Engineering, OSF		uunet!osf.org!dbrooks

I'm new to Motif and am very impressed with its capabilities but I still don't
know too much about it.  I am currently helping develop an application and I
would like to be able to properly disable the window menu to keep the users
from closing dialogs without my program's knowledge.  Could you tell me how to
go about doing this via the "protocol stuff" ?

Any help greatly appreciated...

Gary Thompson
gat@gator.cacs.usl.edu
"I can't complain but sometimes I still do"  Joe Walsh, 'Life's Been Good'

dbrooks@osf.org (David Brooks) (08/01/90)

In article <12399@rouge.usl.edu>, gat@gator.cacs.usl.edu (Gary Thompson)
writes:
>  I am currently helping develop an application and I
> would like to be able to properly disable the window menu to keep the users
> from closing dialogs without my program's knowledge.  Could you tell
me how to
> go about doing this via the "protocol stuff" ?
> 

If you're talking about dialogs, closing them is quite a natural act
and simply unmanages them, removing them from the screen but not
otherwise hurting your application.  You *can* be notified with the
popdown callback (of the shell, not the messagebox or whatever).

For a primary window, if you simply want your user not to be able to
close it, you can do this with a shell resource.  Use:

	Mwm*Class.clientFunctions: -close
or:
	Class*mwmFunctions: 33

Sorry about the magic number.  Or (in 1.0.3 and up) set the resource
XmNmwmFunctions to MWM_FUNC_ALL | MWM_FUNC_CLOSE, which is where the
33 comes from.

Using protocols to cause a callback when "Kill" is selected is
described in the mwm part of the OSF/Motif Programmer's Guide.
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks