[comp.windows.x.motif] Setting win decoration from within an app.

jon@infonode.ingr.com (Jon Stone) (02/19/91)

I want to be able to create some windows running under mwm, and have no
borders placed on the window at all by mwm.  I want to perform this
function from within the app, instead of using the "clientDecoration:
none" in the user's resource file.

The Motif Programmer's Guide has some information about this in section
3.3 "MWM Specific Information", and references the _MOTIF_WM_HINTS
property.  I can't seem to find any information on exactly how to set
this property.  What functions & what arguments do I use?

Also, parts of my application may not be based on Motif, or even Xt. 
Any ideas? A code fragment would be ideal. 

Thanks in advance,

Jon


-- 
_______________________________________________________________________________
Jon D. Stone				jon@ingr.com -or- ..!uunet!ingr!jon
Intergraph Corporation, Huntsville, AL	(205)730-8594
_______________________________________________________________________________

davis@b11.ingr.com (Chris Davis) (02/20/91)

jon@infonode.ingr.com (Jon Stone) writes:

>I want to be able to create some windows running under mwm, and have no
>borders placed on the window at all by mwm.  I want to perform this
>function from within the app, instead of using the "clientDecoration:
>none" in the user's resource file.

If you use any shell widget that has a VendorShell subclass, you will have
programmatic access to a resource called "XmNmwmDecorations".  This resource
allows you to set the decorations of the shell window.

A couple of comments on VendorShell and this resource:

	Note that this resource is of type int, and there isn't any very
	specific documentation on what values are valid for this resource.
	You will have to experiment with it.  You might want to use an 
	app-defaults file at first to find out what numbers correspond to
	what decorations, and then hard code it in your	application once you
	establish the desired results.

	This may be obvious, but note that this widget does NOT cooperate
	well with ANY window manager BUT mwm.

--

chris davis
graphics standards integegration
b11!nuwave!davis

doyle@doyled.ingr.com (Doyle C. Davidson) (02/21/91)

>
>jon@infonode.ingr.com (Jon Stone) writes:
>
>>I want to be able to create some windows running under mwm, and have no
>>borders placed on the window at all by mwm.  I want to perform this
>>function from within the app, instead of using the "clientDecoration:
>>none" in the user's resource file.
>
>If you use any shell widget that has a VendorShell subclass, you will have
>programmatic access to a resource called "XmNmwmDecorations".  This resource
>allows you to set the decorations of the shell window.
>
>A couple of comments on VendorShell and this resource:
>
>	Note that this resource is of type int, and there isn't any very
>	specific documentation on what values are valid for this resource.
>	You will have to experiment with it.  You might want to use an 
>	app-defaults file at first to find out what numbers correspond to
>	what decorations, and then hard code it in your	application once you
>	establish the desired results.
>
>chris davis
See "/usr/include/Xm/MwmUtil.h"
specifically MWM_DECOR_*

Doyle
------------------------------------------------------------------
Doyle C. Davidson              |
Intergraph Corp.               |  These comments are...
   Everywhere You Look!!       |
Third Party Software           |
   Product Development         |     \\  /
(205) 730-2000                 |      \\/
                               |      /\\  clusively my own.
..!b23b!doyled!doyle  -or-     |     /  \\
..!uunet!ingr!doyle            |
------------------------------------------------------------------

davis@b11.ingr.com (Chris Davis) (02/21/91)

doyle@doyled.ingr.com (Doyle C. Davidson) writes:

>>
>>jon@infonode.ingr.com (Jon Stone) writes:
>>
>>>I want to be able to create some windows running under mwm, and have no
>>>borders placed on the window at all by mwm.  I want to perform this
>>>function from within the app, instead of using the "clientDecoration:
>>>none" in the user's resource file.
>>
>>If you use any shell widget that has a VendorShell subclass, you will have
>>programmatic access to a resource called "XmNmwmDecorations".  This resource
>>allows you to set the decorations of the shell window.
>>
>>A couple of comments on VendorShell and this resource:
>>
>>	Note that this resource is of type int, and there isn't any very
>>	specific documentation on what values are valid for this resource.
>>	You will have to experiment with it.  You might want to use an 
>>	app-defaults file at first to find out what numbers correspond to
>>	what decorations, and then hard code it in your	application once you
>>	establish the desired results.
>>
>>chris davis
>See "/usr/include/Xm/MwmUtil.h"
>specifically MWM_DECOR_*

>Doyle C. Davidson


In addition to Doyle's reference, I found some other docs on this subject.
Take a look in the OSF/Motif Programmer's manual at Chapter 12, Section 3.

--

chris davis

doyle@doyled.ingr.com (Doyle C. Davidson) (02/26/91)

>>>>I want to be able to create some windows running under mwm, and have no
>>>>borders placed on the window at all by mwm.  I want to perform this
>>>>function from within the app, instead of using the "clientDecoration:
>>>>none" in the user's resource file.
>>>
>>See "/usr/include/Xm/MwmUtil.h"
>>specifically MWM_DECOR_*
>
>>Doyle C. Davidson
>
>
>In addition to Doyle's reference, I found some other docs on this subject.
>Take a look in the OSF/Motif Programmer's manual at Chapter 12, Section 3.


And now, some example code:
============================ cut here ============================
#include <Xm/MwmUtil.h>

/************************************************************************
 *
 *  SetMwmHints
 *
 ************************************************************************/
static void SetMwmHints(dpy, win, hints)
Display *dpy;
Window win;
MotifWmHints	*hints;
{
    PropMwmHints	prop;
    Atom		mwm_hints_atom;

    mwm_hints_atom = XInternAtom(dpy,
				  _XA_MWM_HINTS, 
				  False);

    prop.flags		= hints->flags;
    prop.functions	= hints->functions;
    prop.decorations	= hints->decorations;
    prop.inputMode	= hints->input_mode;

    XChangeProperty (dpy, win, mwm_hints_atom,mwm_hints_atom, 
		     32, PropModeReplace, 
		     (unsigned char *) &prop, PROP_MWM_HINTS_ELEMENTS);
}	
============================ end here ============================
Doyle
------------------------------------------------------------------
Doyle C. Davidson              |
Intergraph Corp.               |  These comments are...
   Everywhere You Look!!       |
Third Party Software           |
   Product Development         |     \\  /
(205) 730-2000                 |      \\/
                               |      /\\  clusively my own.
..!b23b!doyled!doyle  -or-     |     /  \\
..!uunet!ingr!doyle            |
------------------------------------------------------------------