<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xcwattribman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XCWAttrib.man,v 1.3 2003/04/28 22:17:54 herrb Exp $ -->

<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XChangeWindowAttributes</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XChangeWindowAttributes</refname>
<refname>XSetWindowBackground</refname>
<refname>XSetWindowBackgroundPixmap</refname>
<refname>XSetWindowBorder</refname>
<refname>XSetWindowBorderPixmap</refname>
<refname>XSetWindowColormap</refname>
<refpurpose>change window attributes</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>int XChangeWindowAttributes&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, unsigned long <emphasis remap='I'>valuemask</emphasis>&hairsp;, XSetWindowAttributes *<emphasis remap='I'>attributes</emphasis>&hairsp;);</para>

<para>int XSetWindowBackground&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, unsigned long <emphasis remap='I'>background_pixel</emphasis>&hairsp;);</para>

<para>int XSetWindowBackgroundPixmap&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window
<emphasis remap='I'>w</emphasis>&hairsp;, Pixmap <emphasis remap='I'>background_pixmap</emphasis>&hairsp;);</para>

<para>int XSetWindowBorder&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, unsigned long <emphasis remap='I'>border_pixel</emphasis>&hairsp;);</para>

<para>int XSetWindowBorderPixmap&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, Pixmap <emphasis remap='I'>border_pixmap</emphasis>&hairsp;);</para>

<para>int XSetWindowColormap&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Window <emphasis remap='I'>w</emphasis>&hairsp;, Colormap <emphasis remap='I'>colormap</emphasis>&hairsp;);</para>
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>attributes</emphasis></term>
  <listitem>
<para>Specifies the structure from which the values (as specified by the value mask)
are to be taken.
The value mask should have the appropriate bits
set to indicate which attributes have been set in the structure.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>background_pixel</emphasis></term>
  <listitem>
<para>Specifies the pixel that is to be used for the background.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>background_pixmap</emphasis></term>
  <listitem>
<para>Specifies the background pixmap,
<emphasis remap='I'>&hairsp;ParentRelative&hairsp;</emphasis>,
or
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>border_pixel</emphasis></term>
  <listitem>
<para>Specifies the entry in the colormap.</para> 
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>border_pixmap</emphasis></term>
  <listitem>
<para>Specifies the border pixmap or
<emphasis remap='I'>&hairsp;CopyFromParent&hairsp;</emphasis>.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>valuemask</emphasis></term>
  <listitem>
<para>Specifies which window attributes are defined in the attributes
argument.
This mask is the bitwise inclusive OR of the valid attribute mask bits.
If valuemask is zero,
the attributes are ignored and are not referenced.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>w</emphasis></term>
  <listitem>
<para>Specifies the window.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>colormap</emphasis></term>
  <listitem>
<para>Specifies the colormap.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>Depending on the valuemask,
the
<emphasis remap='I'>&hairsp;XChangeWindowAttributes&hairsp;</emphasis>
function uses the window attributes in the
<emphasis remap='I'>&hairsp;XSetWindowAttributes&hairsp;</emphasis>
structure to change the specified window attributes.
Changing the background does not cause the window contents to be
changed.
To repaint the window and its background, use 
<emphasis remap='I'>&hairsp;XClearWindow&hairsp;</emphasis>.
Setting the border or changing the background such that the
border tile origin changes causes the border to be repainted.
Changing the background of a root window to 
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>
or 
<emphasis remap='I'>&hairsp;ParentRelative&hairsp;</emphasis>
restores the default background pixmap.
Changing the border of a root window to
<emphasis remap='I'>&hairsp;CopyFromParent&hairsp;</emphasis>
restores the default border pixmap.
Changing the win-gravity does not affect the current position of the
window.
Changing the backing-store of an obscured window to 
<emphasis remap='I'>&hairsp;WhenMapped&hairsp;</emphasis>
or
<emphasis remap='I'>&hairsp;Always&hairsp;</emphasis>,
or changing the backing-planes, backing-pixel, or
save-under of a mapped window may have no immediate effect.
Changing the colormap of a window (that is, defining a new map, not
changing the contents of the existing map) generates a 
<emphasis remap='I'>&hairsp;ColormapNotify&hairsp;</emphasis>
event.
Changing the colormap of a visible window may have no
immediate effect on the screen because the map may not be installed
(see
<emphasis remap='I'>&hairsp;XInstallColormap&hairsp;</emphasis>).
Changing the cursor of a root window to 
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>
restores the default
cursor.
Whenever possible, you are encouraged to share colormaps.</para>

<para>Multiple clients can select input on the same window. 
Their event masks are maintained separately.
When an event is generated, 
it is reported to all interested clients. 
However, only one client at a time can select for 
<emphasis remap='I'>&hairsp;SubstructureRedirectMask&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;ResizeRedirectMask&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;ButtonPressMask&hairsp;</emphasis>.
If a client attempts to select any of these event masks 
and some other client has already selected one, 
a
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>
error results.
There is only one do-not-propagate-mask for a window, 
not one per client.</para>

<para><emphasis remap='I'>&hairsp;XChangeWindowAttributes&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadColor&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadCursor&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadPixmap&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowBackground&hairsp;</emphasis>
function sets the background of the window to the specified pixel value.
Changing the background does not cause the window contents to be changed.
<emphasis remap='I'>&hairsp;XSetWindowBackground&hairsp;</emphasis>
uses a pixmap of undefined size filled with the pixel value you passed.
If you try to change the background of an 
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window, a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowBackground&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowBackgroundPixmap&hairsp;</emphasis>
function sets the background pixmap of the window to the specified pixmap.
The background pixmap can immediately be freed if no further explicit
references to it are to be made.
If 
<emphasis remap='I'>&hairsp;ParentRelative&hairsp;</emphasis>
is specified, 
the background pixmap of the window's parent is used,
or on the root window, the default background is restored.
If you try to change the background of an 
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window, a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.
If the background is set to
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>,
the window has no defined background.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowBackgroundPixmap&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadPixmap&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowBorder&hairsp;</emphasis>
function sets the border of the window to the pixel value you specify.
If you attempt to perform this on an
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window, a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowBorder&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowBorderPixmap&hairsp;</emphasis>
function sets the border pixmap of the window to the pixmap you specify.
The border pixmap can be freed immediately if no further explicit
references to it are to be made.
If you specify
<emphasis remap='I'>&hairsp;CopyFromParent&hairsp;</emphasis>,
a copy of the parent window's border pixmap is used.
If you attempt to perform this on an
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window, a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowBorderPixmap&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadPixmap&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XSetWindowColormap&hairsp;</emphasis>
function sets the specified colormap of the specified window.
The colormap must have the same visual type as the window,
or a
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>
error results.</para>

<para><emphasis remap='I'>&hairsp;XSetWindowColormap&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadColor&hairsp;</emphasis>,
<emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis>,
and
<emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis>
errors.</para>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis></term>
  <listitem>
<para>A client attempted
to free a color map entry that it did not already allocate.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAccess&hairsp;</emphasis></term>
  <listitem>
<para>A client attempted
to store into a read-only color map entry.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadColor&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Colormap argument does not name a defined Colormap.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadCursor&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Cursor argument does not name a defined Cursor.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis></term>
  <listitem>
<para>Some argument or pair of arguments has the correct type and range but fails
to match in some other way required by the request.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadMatch&hairsp;</emphasis></term>
  <listitem>
<para>An
<emphasis remap='I'>&hairsp;InputOnly&hairsp;</emphasis>
window locks this attribute.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadPixmap&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Pixmap argument does not name a defined Pixmap.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis></term>
  <listitem>
<para>Some numeric value falls outside the range of values accepted by the request.
Unless a specific range is specified for an argument, the full range defined
by the argument's type is accepted.  Any argument defined as a set of
alternatives can generate this error.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadWindow&hairsp;</emphasis></term>
  <listitem>
<para>A value for a Window argument does not name a defined Window.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XConfigureWindow(3X11),
XCreateWindow(3X11),
XDestroyWindow(3X11),
XInstallColormap(3X11),
XMapWindow(3X11),
XRaiseWindow(3X11),
XUnmapWindow(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

