This section describes which widget and gadget resources are locale-sensitive. The information is organized by related functionality. For example, the first section describes those resources that are locale-sensitive for widgets used to display labels or to provide push-button functionality.
Table 2-2 lists the localized resources that are used as labels. Many of them are of type XmString. The rest are of type color or char*. See the Motif 1.2 Reference Manual for detailed descriptions of these resources. In each case, the application should not hardcode these resources. If resource values need to be specified by the application, it should be done with the app-defaults file, ensuring that the resource can be localized.
Only the widget class resources are listed here; subclasses of these widgets are not listed. For example, the XmDrawnButton widget class does not introduce any new resources that are localized. However, it is a subclass of the XmLabelWidget widget class; therefore, its accelerator resource, acceleratorText resource, and so on, are also localized and should not be hardcoded by an application.
Table 2-2 Localized Resources
Note that the XmRowColumn widget has additional string resources that may be localized. These resources are listed in the XmRowColumn man page, under the heading "Simple Menu Creation Resource Set." As the title implies, these resources affect only RowColumn widgets created with the XmCreateSimpleMenu() function. The resources affected are: *buttonAccelerators, *buttonAcceleratorText, *buttonMnemonics,*optionLabel, and *optionMnemonic. These resources are not included in Table 2-2 because they are rarely used and apply to RowColumn only when creating a simple menu.
Several widgets allow applications to set or read lists of items in the widget. Table 2-3 shows which widgets allow this and the resources they use to set or read these lists. Because the list items may need to be localized, do not hardcode these lists. Rather, they should be set as resources in app-defaults files, allowing them to be localized. The type for each list is XmStringList.
Table 2-3 Resources Used for Reading Lists
Widget Class |
Resource Name |
---|---|
XmList |
*items: |
XmList |
*selectedItems: |
XmSelectionBox |
*listItems: |
Table 2-4 lists the resources used for setting titles and icon names. Normally, an application need only set the *title: and *iconName: resources. The encoding of each is automatically detected for clients doing proper locale management. All of these are of type char or XmString.
Table 2-4 Resources Used for Setting Titles and Icon Names
Table 2-5 lists the Text[Field] resources that are locale-sensitive or about which the developer of an internationalized application should know.
Table 2-5 Locale-Sensitive Text[Field] Resources
Table 2-6 lists localized resources for customizing the input method. These resources allow the user or the application to control which input method will be used for the specified locale and which preedit style (if applicable and available) will be used.
Table 2-6 Localized Resources for Input Method Customization
Widget Class |
Resource Name |
---|---|
VendorShell |
*inputMethod: |
VendorShell |
*preeditType: |
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:
If the XBMLANGPATH environment variable is set, the value of that variable is the search path.
If XBMLANGPATH is not set but XAPPLRESDIR is set, the XmGetPixmapByDepth() function uses a default search path with entries that include $XAPPLRESDIR, the user's home directory, and vendor-dependent system directories.
If neither XBMLANGPATH nor XAPPLRESDIR is set, the XmGetPixmapByDepth() function uses a default search path with entries that include the user's home directory and vendor-dependent system directories.
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.)
Table 2-8 lists the localized font resources. All XmFontList resources are of type XmFontList. In almost all cases, a fontset should be used when specifying a fontlist element. The only exception is when displaying character data that does not appear in the character set of the user (for example, displaying math symbols or dingbats).
Table 2-8 Localized Font Resources
Widget Class |
Resource Name |
---|---|
VendorShell |
*buttonFontList: |
VendorShell |
*defaultFontList: |
VendorShell |
*labelFontList: |
VendorShell |
*textFontList: |
XmBulletinBoard |
*buttonFontList: |
XmBulletinBoard |
*defaultFontList: |
XmBulletinBoard |
*labelFontList: |
XmBulletinBoard |
*textFontList: |
XmLabel[Gadget] |
*fontList: |
XmList |
*fontList: |
XmMenuShell |
*buttonFontList: |
XmMenuShell |
*defaultFontList: |
XmMenuShell |
*labelFontList: |
XmText |
*fontList: |
XmTextField |
*fontList: |