Page:Xlib - C Language X Interface.pdf/40

{| style="text-align:center;" cellspacing=0 ! align=left style="border-bottom:solid 1px black; border-top:solid 1px black;" width=200px | Attribute ! align=left style="border-bottom:solid 1px black; border-top:solid 1px black;" width=100px | Default ! style="border-bottom:solid 1px black; border-top:solid 1px black;" width=100px | InputOutput ! style="border-bottom:solid 1px black; border-top:solid 1px black;" width=100px | InputOnly
 * align=left | backing-store        || align=left | NotUseful        || Yes         || No
 * align=left | backing-planes       || align=left | Allones                || Yes         || No
 * align=left | backing-pixel        || align=left | zero                   || Yes         || No
 * align=left | save-under           || align=left | False            || Yes         || No
 * align=left | event-mask           || align=left | emptyset               || Yes         || Yes
 * align=left | do-not-propagate-mask || align=left | emptyset              || Yes         || Yes
 * align=left | override-redirect    || align=left | False            || Yes         || Yes
 * align=left | colormap             || align=left | CopyFromParent   || Yes         || No
 * align=left style="border-bottom:solid 1px black;" | cursor
 * align=left style="border-bottom:solid 1px black;" | None
 * style="border-bottom:solid 1px black;" | Yes
 * style="border-bottom:solid 1px black;" | Yes
 * }
 * align=left | override-redirect    || align=left | False            || Yes         || Yes
 * align=left | colormap             || align=left | CopyFromParent   || Yes         || No
 * align=left style="border-bottom:solid 1px black;" | cursor
 * align=left style="border-bottom:solid 1px black;" | None
 * style="border-bottom:solid 1px black;" | Yes
 * style="border-bottom:solid 1px black;" | Yes
 * }
 * style="border-bottom:solid 1px black;" | Yes
 * }

 3.2.1. Background Attribute 

Only InputOutput windows can have a background. You can set the background of an InputOutput window by using a pixel or a pixmap.

The background-pixmap attribute of a window specifies the pixmap to be used for a window's background. This pixmap can be of any size, although some sizes may be faster than others. The background-pixel attribute of a window specifies a pixel value used to paint a window's background in a single color.

You can set the background-pixmap to a pixmap, None (default), or ParentRelative. You can set the background-pixel of a window to any pixel value (no default). If you specify a background-pixel, it overrides either the default background-pixmap or any value you may have set in the background-pixmap. A pixmap of an undefined size that is filled with the background-pixel is used for the background. Range checking is not performed on the background pixel; it simply is truncated to the appropriate number of bits.

If you set the background-pixmap, it overrides the default. The background-pixmap and the window must have the same depth, or a BadMatch error results. If you set background-pixmap to None, the window has no defined background. If you set the background-pixmap to ParentRelative:


 * The parent window's background-pixmap is used. The child window, however, must have the same depth as its parent, or a BadMatch error results.
 * If the parent window has a background-pixmap of None, the window also has a background-pixmap of None.
 * Acopy of the parent window's background-pixmap is not made. The parent's background-pixmap is examined each time the child window's background-pixmap is required.
 * The background tile origin always aligns with the parent window's background tile origin. If the background-pixmap is not ParentRelative, the background tile origin is the child window's origin.

Setting a new background, whether by setting background-pixmap or background-pixel, overrides any previous background. The background-pixmap can be freed immediately if no further explicit reference is made to it (the X server will keep a copy to use when needed). If you later draw into the pixmap used for the background, what happens is undefined because the X implementation is free to make a copy of the pixmap or to use the same pixmap.

When no valid contents are available for regions of a window and either the regions are visible or the server is maintaining backing store, the server automatically tiles the regions with the window's background unless the window has a background of None. If the background is None, the