Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xsetwindowe(3) [hpux man page]

XSetWindowBackgroundPixmap()											      XSetWindowBackgroundPixmap()

Name
  XSetWindowBackgroundPixmap - change the background tile attribute of a window.

Synopsis
  XSetWindowBackgroundPixmap(display, w, background_pixmap)
	Display *display;
	Window w;
	Pixmap background_pixmap;

Arguments
  display  Specifies a connection to an X server; returned from XOpenDisplay().

  w	   Specifies the window ID.  Must be an InputOutput class window.

  background_pixmap
	   Specifies a pixmap ID, None or ParentRelative, to be used as a background.

Description
  XSetWindowBackgroundPixmap()	sets  the  background_pixmap  attribute  of  a window.	This overrides any previous background_pixel or back-
  ground_pixmap attribute setting set with XSetWindowBackgroundPixmap(), XSetWindowBackground(), or XChangeWindowAttributes().	Drawing  into
  the  pixmap  that  was  set as the background pixmap attribute has an undefined effect on the window background.  The server may or may not
  make a copy of the pixmap.

  If the background is set to a pixmap, the background is tiled with the pixmap.  If the pixmap is not explicitly referenced again, it can be
  freed,  since a copy is maintained in the server.  The background of the window will not be redrawn with the new tile until the next Expose
  event or XClearWindow() call.

  If the background is set to None, the window background initially will be invisible and will share the bits of its parent, but only if  the
  background_pixel attribute is not set.  When anything is drawn by any client into the area enclosed by the window, the contents will remain
  until the area is explicitly cleared with XClearWindow().  The background is not automatically refreshed after exposure.

  If the background is set to ParentRelative, the parent's background is used, and the origin for tiling is the parent's origin (or the  par-
  ent's parent if the parent's background_pixmap attribute is also ParentRelative, and so on).	The difference between setting ParentRelative
  and explicitly setting the same pixmap as the parent is the origin of the tiling.  The difference between ParentRelative and None  is  that
  for ParentRelative the background is automatically repainted on exposure.

  For  ParentRelative, the window must have the same depth as the parent, or a BadMatch error will occur.  If the parent has background None,
  then the window will also have background None.  The parent's background is re-examined each time the window background is  required	(when
  it  needs  to  be redrawn due to mapping or exposure).  The window's contents will be lost when the window is moved relative to its parent,
  and the contents will have to be redrawn.

  Changing the background_pixmap attribute of the root window to None or ParentRelative restores the default.

  XSetWindowBackgroundPixmap() can only be performed on an InputOutput window.	A BadMatch error will result otherwise.

  XSetWindowBackground() may be used if a solid color instead of a tile is desired.

  For more information, see Volume One, Chapter 4, Window Attributes.

Errors
  BadMatch
  BadPixmap
  BadWindow

See Also
  XCreateBitmapFromData(), XCreatePixmap(), XCreatePixmapFromBitmapData(), XFreePixmap(), XQueryBestSize(), XQueryBestStipple(),  XQueryBest-
  Tile(), XReadBitmapFile(), XSetTile(), XSetWindowBorderPixmap(), XWriteBitmapFile().

Xlib - Pixmaps and Tiles											      XSetWindowBackgroundPixmap()

Check Out this Related Man Page

XChangeWindowAttributes(3X11)					  XLIB FUNCTIONS				     XChangeWindowAttributes(3X11)

NAME
XChangeWindowAttributes, XSetWindowBackground, XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap, XSetWindowColormap - change window attributes SYNTAX
XChangeWindowAttributes(display, w, valuemask, attributes) Display *display; Window w; unsigned long valuemask; XSetWindowAttributes *attributes; XSetWindowBackground(display, w, background_pixel) Display *display; Window w; unsigned long background_pixel; XSetWindowBackgroundPixmap(display, w, background_pixmap) Display *display; Window w; Pixmap background_pixmap; XSetWindowBorder(display, w, border_pixel) Display *display; Window w; unsigned long border_pixel; XSetWindowBorderPixmap(display, w, border_pixmap) Display *display; Window w; Pixmap border_pixmap; XSetWindowColormap(display, w, colormap) Display *display; Window w; Colormap colormap; ARGUMENTS
attributes 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. background_pixel Specifies the pixel that is to be used for the background. background_pixmap Specifies the background pixmap, ParentRelative, or None. border_pixel Specifies the entry in the colormap. border_pixmap Specifies the border pixmap or CopyFromParent. display Specifies the connection to the X server. valuemask 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. w Specifies the window. colormap Specifies the colormap. DESCRIPTION
Depending on the valuemask, the XChangeWindowAttributes function uses the window attributes in the XSetWindowAttributes 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 XClearWindow. 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 None or ParentRelative restores the default background pixmap. Changing the border of a root window to CopyFromParent restores the default border pixmap. Changing the win-gravity does not affect the current posi- tion of the window. Changing the backing-store of an obscured window to WhenMapped or Always, 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 ColormapNotify event. Changing the colormap of a visible window may have no immedi- ate effect on the screen because the map may not be installed (see XInstallColormap). Changing the cursor of a root window to None restores the default cursor. Whenever possible, you are encouraged to share colormaps. 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 SubstructureRedirectMask, ResizeRedirectMask, and ButtonPressMask. If a client attempts to select any of these event masks and some other client has already selected one, a BadAccess error results. There is only one do-not-propagate-mask for a window, not one per client. XChangeWindowAttributes can generate BadAccess, BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors. The XSetWindowBackground function sets the background of the window to the specified pixel value. Changing the background does not cause the window contents to be changed. XSetWindowBackground uses a pixmap of undefined size filled with the pixel value you passed. If you try to change the background of an InputOnly window, a BadMatch error results. XSetWindowBackground can generate BadMatch and BadWindow errors. The XSetWindowBackgroundPixmap function sets the background pixmap of the window to the specified pixmap. The background pixmap can imme- diately be freed if no further explicit references to it are to be made. If ParentRelative is specified, the background pixmap of the win- dow's parent is used, or on the root window, the default background is restored. If you try to change the background of an InputOnly win- dow, a BadMatch error results. If the background is set to None, the window has no defined background. XSetWindowBackgroundPixmap can generate BadMatch, BadPixmap, and BadWindow errors. The XSetWindowBorder function sets the border of the window to the pixel value you specify. If you attempt to perform this on an InputOnly window, a BadMatch error results. XSetWindowBorder can generate BadMatch and BadWindow errors. The XSetWindowBorderPixmap function sets the border pixmap of the window to the pixmap you specify. The border pixmap can be freed immedi- ately if no further explicit references to it are to be made. If you specify CopyFromParent, a copy of the parent window's border pixmap is used. If you attempt to perform this on an InputOnly window, a BadMatch error results. XSetWindowBorderPixmap can generate BadMatch, BadPixmap, and BadWindow errors. The XSetWindowColormap function sets the specified colormap of the specified window. The colormap must have the same visual type as the window, or a BadMatch error results. XSetWindowColormap can generate BadColor, BadMatch, and BadWindow errors. DIAGNOSTICS
BadAccess A client attempted to free a color map entry that it did not already allocate. BadAccess A client attempted to store into a read-only color map entry. BadColor A value for a Colormap argument does not name a defined Colormap. BadCursor A value for a Cursor argument does not name a defined Cursor. BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request. BadMatch An InputOnly window locks this attribute. BadPixmap A value for a Pixmap argument does not name a defined Pixmap. BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argu- ment, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. BadWindow A value for a Window argument does not name a defined Window. SEE ALSO
XConfigureWindow(3X11), XCreateWindow(3X11), XDestroyWindow(3X11), XInstallColormap(3X11), XMapWindow(3X11), XRaiseWindow(3X11), XUnmapWin- dow(3X11) Xlib - C Language X Interface X Version 11 Release 6.6 XChangeWindowAttributes(3X11)
Man Page