4
<meta http-equiv="Content-Type" content="text/html">
5
<meta name="description" content="Pcb">
6
<meta name="generator" content="makeinfo 4.6">
7
<meta http-equiv="Content-Style-Type" content="text/css">
8
<style type="text/css"><!--
9
pre.display { font-family:inherit }
10
pre.format { font-family:inherit }
11
pre.smalldisplay { font-family:inherit; font-size:smaller }
12
pre.smallformat { font-family:inherit; font-size:smaller }
13
pre.smallexample { font-size:smaller }
14
pre.smalllisp { font-size:smaller }
20
Node: <a name="Resource%20Syntax">Resource Syntax</a>,
21
Next: <a rel="next" accesskey="n" href="Menu-Definitions.html#Menu%20Definitions">Menu Definitions</a>,
22
Up: <a rel="up" accesskey="u" href="Custom-Menus.html#Custom%20Menus">Custom Menus</a>
26
<h3 class="section">Resource Syntax</h3>
28
<p>A resource file is a simple text file. It contains curly braces to
29
group things, spaces between things, and double quotes when strings
30
need to include spaces. There are four fundamental ways of adding
33
<p>First, a string (either a single word or a quoted string with spaces,
34
we call both "strings" in this appendix) can be added all by itself,
35
to add a string resource to the current resource. This is used, for
36
example, to define the string printed on a menu button. In this
37
example, four strings are added to the <var>File</var> resource:
39
<pre class="example"> File = {
46
<p>Second, a named string may be added by giving two strings separated by
47
an equals sign. This is used to specify X resources and a few other
48
optional parameters of menus, for example. Note that a string all by
49
itself is thus an "unnamed" string.
51
<pre class="example"> {"Layer groups" foreground=red sensitive=false}
54
<p>Third, an unnamed subresource may be added. This is used to create
55
submenus and menu buttons. To add a subresource, simply group other
56
things in curly braces. This example describes a resource containing
57
one string and three subresources:
59
<pre class="example"> {File
66
<p>Lastly, a named subresource may be added by prefixing an unnamed
67
subresource with a string and an equals sign, just as when naming
68
strings. This syntax is used to name the resources used for the main
71
<pre class="example"> MainMenu = {
76
<p>Additionally, the menu parser allows for "hooks" whereby portions of
77
the menu system can be programmatically created at runtime by the
78
application. These hooks are invoked by a single word proceeded by an
79
at sign, such as this example where most of the Sizes menu is created
82
<pre class="example"> {Sizes
84
{"Adjust active sizes ..." AdjustStyle(0)}
88
<p>In addition to all that, any unquoted pound sign (<code>#</code>) begins a
89
comment. Commented text continues until the end of the containing
90
line. Comments may begin at the beginning of a line, or after other
93
<pre class="example"> # This is a comment
94
MainMenu = { # This is also a comment