Common X11 programming issues are discussed in the following sections.
The OpenWindows version of Xlib supports Compose Key processing through calls to XLookupString.
On IA keyboards, use the Control-Shift-F1 key sequence for the Compose Key functionality.
The OpenWindows version of Xlib supports NumLock Key processing through calls to XLookupString. This change does not affect the NumLock processing that exists in XView, OLIT, Motif, or X applications.
On IA keyboards, the NumLock Key resides in the top line of the keypad section of the keyboard.
The color name database provides a mapping between ASCII color names and RGB color values. This mapping increases the portability of color programs and eases programming. Note that this mapping is subjective and has no objective scientific basis.
The source of the database is /usr/openwin/lib/X11/rgb.txt. This file is identical to the one provided in X11R6 from the X Consortium. rgb.txt is compiled into the dbm(3) database files, rgb.dir and rgb.pag. When the server starts up, it builds an internal representation of rgb.dir and rgb.pag used to map a color name to a color value.
X11 clients use XLookupColor or XAllocNamedColor to map a color name to a color value. The color name string passed to these routines is converted to lowercase before it is looked up in the database.
This section contains recommendations for using the Solaris X server color support facilities. Use these hints to maximize portability and color sharing:
Do not rely on the locations of black and white in the default PseudoColor colormap. Always use XAllocColor to allocate a pixel for rendering.
Do not rely on black and white being in certain pixel locations. Future versions of the Solaris X server and the servers of other vendors may have these colors located in different positions than the current server. For maximum portability and compatibility, always write X11 clients so that they use the XAllocColor function to allocate desired colors for rendering.
Do not use a visual before you have checked on all supported visual types, using XGetVisualInfo or XMatchVisualInfo. Note that XGetVisualInfo is the recommended function to use because it has the ability to distinguish between visuals of the same class and depth.
To reduce colormap flashing, it is usually a good policy to try to first allocate colors from the default colormap. Only when this allocation fails should you create a private colormap.
For more hints on writing portable X11 color clients, see Hints for Windows Programming With Visuals.