XSetRGBColormaps

Syntax

void XSetRGBColormaps(display, w, std_colormap, count, property)
      Display *display;
      Window w;
      XStandardColormap *std_colormap;
      int count;
      Atom property;

Arguments

display Specifies the connection to the X server.
w Specifies the window.
std_colormap Specifies the XStandardColormap structure to be used.
count Specifies the number of colormaps.
property Specifies the property name.

Description

The XSetRGBColormaps() function replaces the RGB colormap definition in the specified property on the named window. If the property does not already exist, XSetRGBColormaps() sets the RGB colormap definition in the specified property on the named window. The property is stored with a type of RGB_COLOR_MAP and a format of 32. Note that it is the caller's responsibility to honor the XStoreColors() to store appropriate color values in the colormap.
  • Fill in the descriptive members in the XStandardColormap structure.
  • Attach the property to the root window.
  • Use XSetCloseDownMode() to make the resource permanent.

  • Ungrab the server.

    XSetRGBColormaps() can generate BadAlloc, BadAtom, and BadWindow errors.

    Diagnostics

    BadAlloc The server failed to allocate the requested source or server memory.
    BadAtom A value for an Atom argument does not name a defined Atom.
    BadWindow A value for a Window argument does not name a defined Window.

    See also

    XAllocStandardColormap(), XGetRGBColormaps(), XStandardColormap, XAllocColor(), XCreateColormap(), XFree(), XSetCloseDownMode(), "Setting and Obtaining Standard Colormaps".
    Christophe Tronche, ch.tronche@computer.org