Appendix 2: Using X resources

You can use a number of X resources to configure the appearance of HoTMetaL.

A global application defaults file called Hm2,is provided with the HoTMetaL software. On installation, this file is placed in the directory named by the environment variable XFILESEARCHPATH: this is /usr/lib/X11/app-defaults by default. You may choose to have the file Hm2, installed in another directory: if you do so, this directory must either be named by the environment variable XAPPLRESDIR, be in the list of directories named by XFILESEARCHPATH, or be your home directory. In addition to this, each user can have their personal X resources read from a file which is loaded by the program xrdb. Any resources set in the file .Xdefaults in the user's home directory will be read by default.

Each Motif application has a class name and an application name. For a personal X resource to take effect for a particular invocation of HoTMetaL, it must start with either the class name or the application name. The class name is shared by all invocations of the same program: HoTMetaL's class name is Hm2, so all invocations of HoTMetaL have this class name. The default application name is the same as the name of the binary executable file. Therefore, unless you have changed the name of this file, hm2 is the default application name for HoTMetaL. The application name may be changed for individual invocations of HoTMetaL by calling HoTMetaL with the -name command line option. For example: changes the application name to myhm2.

Format of X resources

X resources affect the appearance of widgets, which are graphical objects, such as file selection dialogs, lists, and buttons. Widgets may be contained within other widgets: for example, a file selection dialog contains buttons.

The format of an X resource is as follows:

Hm2*widget1*widget2* . . . widgetn*resource: value

where widget2 is contained in widget1, widget3 is contained in widget2, and so forth. The resource is some characteristic of the widget, such as color, font, width, etc. The resource applies only to the last widget in the series, and only when it occurs in the given nesting sequence.

The resource that applies to a particular widget is the one that is specified most completely for that widget. For example:

*Background:	white
*XmText*Background:	blue

As a result of these settings, text entry boxes (XmText), will have a blue background rather than white.

Widgets

Most of the widgets used in HoTMetaL can be accessed using the following HoTMetaL-specific names, or by their generic Motif names. For example, Dialog may be used interchangeably with XmForm. Note, however, the following exceptions:

Button
a push button
CHsb
context view horizontal scroll bar
CVsb
context view vertical scroll bar
CheckBox
a check box
ContextView
HoTMetaL's context view
Dialog
dialog box
ErrorBox
error box
Form
the widget inside a dialog, containing all control items
Frame
widget that places a 3-D border around a window
GpCheckBox
a group of check boxes
GpChoice
a group of radio (diamond) boxes
InformationBox
an information box
Label
a label
List
a list
LoadDialog
file selection dialog
MBButton
button for MenuButton widget
MBMenu
menu for MenuButton widget
MBText
text field for MenuButton widget
MainWindow
main HoTMetaL window
Menu
a menu
MenuBar
menu bar
MenuButton
an option menu with a text box (e.g., Font Size)
MessageWindow
window where progress status and rules checking status are displayed
Progress
progress status (displayed in MessageWindow)
SHsb
structure window horizontal scroll bar
SVsb
structure window vertical scroll bar
ScrollWindow
a scrolled window
Stack
an option menu without a text box (e.g., Font Family)
StackMenu
pull-down menu for a stack
StartDialog
start-up dialog
State
rules checking status
OutlineView
the HoTMetaL structure window
Text
text
Toggle
a group of check boxes
VHsb
main window horizontal scroll bar
VVsb
main window vertical scroll bar
ViewWindow
widget on which graphic context is drawn (e.g., Context View, Structure View)
WarningBox
warning box

Resources

The following lists the most useful resources that can be set for HoTMetaL widgets. This is not a complete list of all the resources: refer to your Motif documentation for more information. The resource type is given in brackets after the description.

Background
background of window or dialog box (color)
BorderColor
color of borders for window or dialog box (color)
Foreground
color of text and borders (color)
BottomShadowColor
Bottom and right shadow of widget border (color)
TopShadowColor
Top and left shadow of widget border (color)
activeBottomShadowColor
Bottom and right shadow of active widget border (color)
activeTopShadowColor
Top and left shadow of active widget border (color)
fontList
font for text (font)
height
height of window or dialog box (number - pixels)
troughColor
color of area behind scrollbar (color)
width
width of window or dialog box (number - pixels)

For resources that have color values, you can use the same colors as you use with HoTMetaL's Color... command. Resources which name fonts should be set to an X standard format font name, or an alias for such a font name. The program xlsfonts will give you the names of the fonts and aliases available on your system.