Common Desktop Environment: Internationalization Programmer's Guide

Pixmap (Icon) Resources

Table 2-7 lists pixmap resources. In some cases, a different pixmap may be needed for a given locale.

Table 2-7 Pixmap Resources

Widget Class 

Resource Name 

Core

*backgroundPixmap:

WMShell

*iconPixmap:

XmDragIcon

*pixmap:

XmDropSite

*animation[Mask|Pixmap]:

XmLabel[Gadget]

*labelInsensitivePixmap:

XmLabel[Gadget]

*labelPixmap:

XmMessageBox

*symbolPixmap:

XmPushButton[Gadget]

*armPixmap:

XmToggleButton[Gadget]

*selectInsensitivePixmap:

XmToggleButton[Gadget]

*selectPixmap:

A pixmap is a screen image that is stored in memory so that it can be recalled and displayed when needed. The desktop has a number of pixmap resources that allow the application to supply pixmaps for backgrounds, borders, shadows, label and button faces, drag icons, and other uses. As with text, some pixmaps may be specific to particular language environments; these pixmaps must be localized.

The desktop maintains caches of pixmaps and images. The XmGetPixmapByDepth() function searches these caches for a requested pixmap. If the requested pixmap is not in the pixmap cache and a corresponding image is not in the image cache, the XmGetPixmapByDepth() function searches for an X bitmap file whose name matches the requested image name. The XmGetPixmapByDepth() function calls the XtResolvePathname() function to search for the file. If the requested image name is an absolute path name, that path name is the search path for the XtResolvePathname() function. Otherwise, the XmGetPixmapByDepth() function constructs a search path in the following way:

These paths may include the %B substitution field. In each call to the XtResolvePathname() function, the XmGetPixmapByDepth() function substitutes the requested image name for %B. The paths may also include other substitution fields accepted by the XtResolvePathname() function. In particular, the XtResolvePathname() function substitutes the display's language string for %L, and it substitutes the components of the display's language string (in a vendor-dependent way) for %l, %t, and %c. The substitution field %T is always mapped to bitmaps, and %S is always mapped to Null.

Because there is no string-to-pixmap converter supplied by default, pixmaps are generally set by the application at creation time by first retrieving the pixmap with a call to XmGetPixmap(). XmGetPixmap() uses the current locale to determine where to locate the pixmap. (See the XmGetPixmap() man page for a description of how locale is used to locate the pixmap.)