2003-11-14 15:54:30 +00:00
. \" 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.
2019-07-29 18:27:12 +02:00
. \" It is provided "as is" without express or implied warranty.
2019-07-30 04:52:25 -04:00
. \"
2004-04-23 18:42:09 +00:00
. \"
2003-11-14 15:54:30 +00:00
.ds xT X Toolkit Intrinsics \- C Language Interface
.ds xW Athena X Widgets \- C Language X Toolkit Interface
.ds xL Xlib \- C Language X Interface
.ds xC Inter-Client Communication Conventions Manual
2006-10-10 22:11:05 -04:00
.TH XChangeWindowAttributes __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
2003-11-14 15:54:30 +00:00
.SH NAME
XChangeWindowAttributes, XSetWindowBackground, XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap, XSetWindowColormap \- change window attributes
.SH SYNTAX
2004-04-23 18:42:09 +00:00
.HP
int XChangeWindowAttributes\^ (\^ Display *\fI display\fP \^ , Window \fI w\fP \^ , unsigned long \fI valuemask\fP \^ , XSetWindowAttributes *\fI attributes\fP \^ );
.HP
int XSetWindowBackground\^ (\^ Display *\fI display\fP \^ , Window \fI w\fP \^ , unsigned long \fI background_pixel\fP \^ );
.HP
int XSetWindowBackgroundPixmap\^ (\^ Display *\fI display\fP \^ , Window
\fI w\fP \^ , Pixmap \fI background_pixmap\fP \^ );
2019-07-30 04:52:25 -04:00
.HP
2004-04-23 18:42:09 +00:00
int XSetWindowBorder\^ (\^ Display *\fI display\fP \^ , Window \fI w\fP \^ , unsigned long \fI border_pixel\fP \^ );
.HP
int XSetWindowBorderPixmap\^ (\^ Display *\fI display\fP \^ , Window \fI w\fP \^ , Pixmap \fI border_pixmap\fP \^ );
.HP
int XSetWindowColormap\^ (\^ Display *\fI display\fP \^ , Window \fI w\fP \^ , Colormap \fI colormap\fP \^ );
2003-11-14 15:54:30 +00:00
.SH ARGUMENTS
.IP \fI attributes\fP 1 i
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.
.IP \fI background_pixel\fP 1 i
Specifies the pixel that is to be used for the background.
.IP \fI background_pixmap\fP 1 i
Specifies the background pixmap,
2019-07-03 18:18:09 +02:00
.BR ParentRelative ,
2003-11-14 15:54:30 +00:00
or
2019-07-03 18:18:09 +02:00
.BR None .
2003-11-14 15:54:30 +00:00
.IP \fI border_pixel\fP 1 i
2019-07-30 04:52:25 -04:00
Specifies the entry in the colormap.
2003-11-14 15:54:30 +00:00
.IP \fI border_pixmap\fP 1 i
Specifies the border pixmap or
2019-07-03 18:18:09 +02:00
.BR CopyFromParent .
2003-11-14 15:54:30 +00:00
.IP \fI display\fP 1 i
Specifies the connection to the X server.
.IP \fI valuemask\fP 1 i
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.
.IP \fI w\fP 1 i
Specifies the window.
.IP \fI colormap\fP 1 i
Specifies the colormap.
.SH DESCRIPTION
Depending on the valuemask,
the
2019-07-03 18:18:09 +02:00
.B XChangeWindowAttributes
2003-11-14 15:54:30 +00:00
function uses the window attributes in the
2019-07-03 18:18:09 +02:00
.B XSetWindowAttributes
2003-11-14 15:54:30 +00:00
structure to change the specified window attributes.
Changing the background does not cause the window contents to be
changed.
2019-07-30 04:52:25 -04:00
To repaint the window and its background, use
2019-07-03 18:18:09 +02:00
.BR XClearWindow .
2003-11-14 15:54:30 +00:00
Setting the border or changing the background such that the
border tile origin changes causes the border to be repainted.
2019-07-30 04:52:25 -04:00
Changing the background of a root window to
2019-07-03 18:18:09 +02:00
.B None
2019-07-30 04:52:25 -04:00
or
2019-07-03 18:18:09 +02:00
.B ParentRelative
2003-11-14 15:54:30 +00:00
restores the default background pixmap.
Changing the border of a root window to
2019-07-03 18:18:09 +02:00
.B CopyFromParent
2003-11-14 15:54:30 +00:00
restores the default border pixmap.
Changing the win-gravity does not affect the current position of the
window.
2019-07-30 04:52:25 -04:00
Changing the backing-store of an obscured window to
2019-07-03 18:18:09 +02:00
.B WhenMapped
2003-11-14 15:54:30 +00:00
or
2019-07-03 18:18:09 +02:00
.BR Always ,
2003-11-14 15:54:30 +00:00
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
2019-07-30 04:52:25 -04:00
changing the contents of the existing map) generates a
2019-07-03 18:18:09 +02:00
.B ColormapNotify
2003-11-14 15:54:30 +00:00
event.
Changing the colormap of a visible window may have no
immediate effect on the screen because the map may not be installed
(see
2019-07-03 18:18:09 +02:00
.BR XInstallColormap ).
2019-07-30 04:52:25 -04:00
Changing the cursor of a root window to
2019-07-03 18:18:09 +02:00
.B None
2003-11-14 15:54:30 +00:00
restores the default
cursor.
Whenever possible, you are encouraged to share colormaps.
.LP
2019-07-30 04:52:25 -04:00
Multiple clients can select input on the same window.
2003-11-14 15:54:30 +00:00
Their event masks are maintained separately.
2019-07-30 04:52:25 -04:00
When an event is generated,
it is reported to all interested clients.
However, only one client at a time can select for
2019-07-03 18:18:09 +02:00
.BR SubstructureRedirectMask ,
.BR ResizeRedirectMask ,
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.BR ButtonPressMask .
2019-07-30 04:52:25 -04:00
If a client attempts to select any of these event masks
and some other client has already selected one,
2003-11-14 15:54:30 +00:00
a
2019-07-03 18:18:09 +02:00
.B BadAccess
2003-11-14 15:54:30 +00:00
error results.
2019-07-30 04:52:25 -04:00
There is only one do-not-propagate-mask for a window,
2003-11-14 15:54:30 +00:00
not one per client.
.LP
2019-07-03 18:18:09 +02:00
.B XChangeWindowAttributes
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.BR BadAccess ,
.BR BadColor ,
.BR BadCursor ,
.BR BadMatch ,
.BR BadPixmap ,
.BR BadValue ,
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
.LP
The
2019-07-03 18:18:09 +02:00
.B XSetWindowBackground
2003-11-14 15:54:30 +00:00
function sets the background of the window to the specified pixel value.
Changing the background does not cause the window contents to be changed.
2019-07-03 18:18:09 +02:00
.B XSetWindowBackground
2003-11-14 15:54:30 +00:00
uses a pixmap of undefined size filled with the pixel value you passed.
2019-07-30 04:52:25 -04:00
If you try to change the background of an
2019-07-03 18:18:09 +02:00
.B InputOnly
2003-11-14 15:54:30 +00:00
window, a
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
error results.
.LP
2019-07-03 18:18:09 +02:00
.B XSetWindowBackground
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
.LP
The
2019-07-03 18:18:09 +02:00
.B XSetWindowBackgroundPixmap
2003-11-14 15:54:30 +00:00
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.
2019-07-30 04:52:25 -04:00
If
2019-07-03 18:18:09 +02:00
.B ParentRelative
2019-07-30 04:52:25 -04:00
is specified,
2003-11-14 15:54:30 +00:00
the background pixmap of the window's parent is used,
or on the root window, the default background is restored.
2019-07-30 04:52:25 -04:00
If you try to change the background of an
2019-07-03 18:18:09 +02:00
.B InputOnly
2003-11-14 15:54:30 +00:00
window, a
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
error results.
If the background is set to
2019-07-03 18:18:09 +02:00
.BR None ,
2003-11-14 15:54:30 +00:00
the window has no defined background.
.LP
2019-07-03 18:18:09 +02:00
.B XSetWindowBackgroundPixmap
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.BR BadMatch ,
.BR BadPixmap ,
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
2019-07-30 04:52:25 -04:00
.LP
2003-11-14 15:54:30 +00:00
The
2019-07-03 18:18:09 +02:00
.B XSetWindowBorder
2003-11-14 15:54:30 +00:00
function sets the border of the window to the pixel value you specify.
If you attempt to perform this on an
2019-07-03 18:18:09 +02:00
.B InputOnly
2003-11-14 15:54:30 +00:00
window, a
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
error results.
.LP
2019-07-03 18:18:09 +02:00
.B XSetWindowBorder
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
.LP
The
2019-07-03 18:18:09 +02:00
.B XSetWindowBorderPixmap
2003-11-14 15:54:30 +00:00
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
2019-07-03 18:18:09 +02:00
.BR CopyFromParent ,
2003-11-14 15:54:30 +00:00
a copy of the parent window's border pixmap is used.
If you attempt to perform this on an
2019-07-03 18:18:09 +02:00
.B InputOnly
2003-11-14 15:54:30 +00:00
window, a
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
error results.
.LP
2019-07-03 18:18:09 +02:00
.B XSetWindowBorderPixmap
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.BR BadMatch ,
.BR BadPixmap ,
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
.LP
The
2019-07-03 18:18:09 +02:00
.B XSetWindowColormap
2003-11-14 15:54:30 +00:00
function sets the specified colormap of the specified window.
The colormap must have the same visual type as the window,
or a
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
error results.
.LP
2019-07-03 18:18:09 +02:00
.B XSetWindowColormap
2003-11-14 15:54:30 +00:00
can generate
2019-07-03 18:18:09 +02:00
.BR BadColor ,
.BR BadMatch ,
2003-11-14 15:54:30 +00:00
and
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
errors.
.SH DIAGNOSTICS
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadAccess
2003-11-14 15:54:30 +00:00
A client attempted
to free a color map entry that it did not already allocate.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadAccess
2003-11-14 15:54:30 +00:00
A client attempted
to store into a read-only color map entry.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadColor
2003-11-14 15:54:30 +00:00
A value for a Colormap argument does not name a defined Colormap.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadCursor
2003-11-14 15:54:30 +00:00
A value for a Cursor argument does not name a defined Cursor.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
Some argument or pair of arguments has the correct type and range but fails
to match in some other way required by the request.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadMatch
2003-11-14 15:54:30 +00:00
An
2019-07-03 18:18:09 +02:00
.B InputOnly
2003-11-14 15:54:30 +00:00
window locks this attribute.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadPixmap
2003-11-14 15:54:30 +00:00
A value for a Pixmap argument does not name a defined Pixmap.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadValue
2003-11-14 15:54:30 +00:00
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
2019-07-30 05:07:40 -04:00
by the argument's type is accepted.
Any argument defined as a set of
2003-11-14 15:54:30 +00:00
alternatives can generate this error.
.TP 1 i
2019-07-03 18:18:09 +02:00
.B BadWindow
2003-11-14 15:54:30 +00:00
A value for a Window argument does not name a defined Window.
.SH "SEE ALSO"
2025-07-13 10:57:31 -07:00
.BR XConfigureWindow (__libmansuffix__),
.BR XCreateWindow (__libmansuffix__),
.BR XDestroyWindow (__libmansuffix__),
.BR XInstallColormap (__libmansuffix__),
.BR XMapWindow (__libmansuffix__),
.BR XRaiseWindow (__libmansuffix__),
.BR XUnmapWindow (__libmansuffix__)
2003-11-14 15:54:30 +00:00
.br
\fI \* (xL\fP