13.4 Resource Specification and Matching
A resource specification consists of an optional name of a client, followed by one or more predefined variables that indicate the preference to set, followed by a colon, optional white space, and the actual value of the preference.[54]
The format of these preference strings is most easily seen by looking at a resource database file, such as the one shown in Example 13-5.
Example 13-5. A simple resource database file
*font: fixed .borderWidth: 2 xterm.scrollBar: on xterm.title: xterm xterm.windowName: xterm xterm.boldFont: 8x13 xterm.curses: off xterm.internalBorder: 2 xterm.iconStartup: off xterm.jumpScroll: on xterm.reverseWrap: true xterm.saveLines: 700 xterm.visualBell: off
The options which begin with a period apply to all programs unless overruled by a program-specific entry with the same resource name. The last element between a period or asterisk and the colon is the resource name.
This simple example demonstrates the rules as commonly practiced in Xlib applications. However, there are a number of additional rules that come into play in more complex, object-oriented applications, such as those written with the Xt Toolkit. Preferences may apply only to a particular subwindow within an application. For example, the xmh mail handler allows the user to set preferences for multiple levels of windows. These levels can be specified explicitly or by using a wildcard syntax denoted by the asterisk.
As a result, you should think of the syntax for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access