XChangeProperty()XChangeProperty()NameXChangeProperty – change a property associated with a window.
Synopsis
XChangeProperty(display, w, property, type, format, mode, data, nele‐
ments)
Display *display;
Window w;
Atom property, type;
int format;
int mode;
unsigned char *data;
int nelements;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
w Specifies the ID of the window whose property you want to
change.
property Specifies the property atom.
type Specifies the type of the property. X does not interpret the
type, but simply passes it back to an application that later
calls XGetWindowProperty.
format Specifies whether the data should be viewed as a list of
8-bit, 16-bit, or 32-bit quantities. This information allows
the X server to correctly perform byte-swap operations as
necessary. If the format is 16-bit or 32-bit, you must
explicitly cast your data pointer to a (char *) in the call
to XChangeProperty(). Possible values are 8, 16, and 32.
mode Specifies the mode of the operation. Possible values are
PropModeReplace, PropModePrepend, PropModeAppend.
data Specifies the property data.
nelements Specifies the number of elements in the property.
DescriptionXChangeProperty() changes a property and generates PropertyNotify
events if they have been selected.
XChangeProperty() does the following according to the mode argument:
· PropModeReplace
Discards the previous property value and stores the new data.
· PropModePrepend
Inserts the data before the beginning of the existing data. If
the property is undefined, it is treated as defined with the cor‐
rect type and format with zero-length data. type and format argu‐
ments must match the existing property value; otherwise a BadMatch
error occurs.
· PropModeAppend
Appends the data onto the end of the existing data. If the prop‐
erty is undefined, it is treated as defined with the correct type
and format with zero-length data. type and format arguments must
match the existing property value; otherwise a BadMatch error
occurs.
The property may remain defined even after the client which defined it
exits. The property becomes undefined only if the application calls
XDeleteProperty(), destroys the specified window, or closes the last
connection to the X server.
The maximum size of a property is server-dependent and can vary dynami‐
cally if the server has insufficient memory.
For more information, see Volume One, Chapter 12, Interclient Communi‐
cation.
Errors
BadAlloc
BadAtom
BadMatch
BadValue
BadWindow
See AlsoXDeleteProperty(), XGetAtomName(), XGetFontProperty(), XGetWindowProp‐
erty(), XInternAtom(), XListProperties(), XRotateWindowProperties(),
XSetStandardProperties().
Xlib - Properties XChangeProperty()