XSetWindowBackground()XSetWindowBackground()Name
XSetWindowBackground – set the background pixel value attribute of a
window.
Synopsis
XSetWindowBackground(display, w, background_pixel)
Display *display;
Window w;
unsigned long background_pixel;
Arguments
display Specifies a connection to an X server; returned from XOpenDis‐
play().
w Specifies the window ID. Must be an InputOutput window.
background_pixel
Specifies which entry in the colormap is used as the back‐
ground color. The constant CopyFromParent is NOT valid.
DescriptionXSetWindowBackground() sets the background attribute of a window, set‐
ting the pixel value to be used to fill the background. This overrides
any previous call to XSetWindowBackground or XSetWindowBackground‐
Pixmap() on the same window.
XSetWindowBackground() does not change the current window contents
immediately. The background is automatically repainted after Expose
events. You can also redraw the background without Expose events by
calling XClearWindow() immediately after.
For more information, see Volume One, Chapter 4, Window Attributes.
Errors
BadMatch Setting background of InputOnly window.
BadWindow
See AlsoXChangeWindowAttributes(), XGetGeometry(), XGetWindowAttributes(),
XSetWindowBackgroundPixmap(), XSetWindowBorder(), XSetWindowBorder‐
Pixmap().
Xlib - Window Attributes XSetWindowBackground()