7. Configuring and customizing TrEd

The configuration and customizing of TrEd is possible through the configuration file. When started TrEd tries to search for its configuration file on several places and uses the first configuraton file found:

  1. First TrEd looks for a file given with a command-line parameter -c (see Section 8. for details).

  2. If the HOME system variable is set (on UNIX/Linux this variable points to user's home directory) TrEd searches for .tredrc (mind the dot here) file in that directory.

  3. If the TREDHOME system variable is set TrEd searches for tredrc file in that directory.

  4. TrEd looks for a tredrc file in the directory where the program file of TrEd itself is located.

  5. TrEd looks for a tredrc file in directories ../lib/tred, ../lib/tredlib and ./tredlib/tredrc respectively, relatvely to the directory where the program file of TrEd itself is located.

  6. TrEd looks for a tredrc file in the /usr/share/config/ directory.

If none of these files is found, default values for configuration options are used.

TrEd's configuration file is a plain text file with a very simple structure. It can be edited not only in any editor (like vi, Emacs or Notepad) and also directly from TrEd when the File->Edit Config menu command is issued. In both cases there is a way to update the options used by a running session of TrEd:

Note

Some configuration options even if applyed take effect only after restarting TrEd.

The format of the configuration file is of this simple form:

option_name = value

There may be any amount of white-space between the option name and value but they must be both on the same line. Any characters folowing a semi-colon (;) to the end of line are considered as comment and are ignored. You may also need to quote the value using either double-quotes ("value") or simple quotes ('value') to preserve white-space or semi-colons. The option names are case-insensitive.

The available configuration options may be divided into several categories:

7.1. Colors

BackgroundColor

Background color of the tree-view canvas.

HighlightWindowColor

Color of the frame drawn around the focused view.

CurrentNodeColor

Color to draw the active node. Default is red.

NearestNodeColor

Color to highlight the nearest node to indicate the destination of a possible drop when dragging a node.

TextColor

Color used to display text of normal tree attributes.

TextColorShadow

Color used to display text of shadowed tree attributes.

TextColorHilite

Color used to display text of highlighted tree attributes.

TextColorXHilite

Color used to display text of extra-highlighted tree attributes. See FS-format description to learn about how to specify which attributes are shadowed, highlighted and extra-highlighted.

CustomColorn

Here n stands for any number between 0..9. These options define ten custom colors which may be symbolically refered to and used in the attribute patterns. To refer to the n'th custom color use the sequence #{customn} in the pattern. For more information see Section 5.. See also the AllowCustomColors option which can be used to enable or disable the actual use of the custom colors.

ActiveTextColor

Color used to flash the text of an attribute under the mouse-pointer.

BoxColor

Background color of a border drawn around the text of attributes if the View->Draw Boxes item is checked.

CurrentBoxColor

Background color of a border drawn around the text of the active node's attributes if the View->Draw Boxes item is checked.

HiddenBoxColor

Background color of a border drawn around the text of a hidden node's attributes if the View->Draw Boxes and View->Show Hidden items are checked.

LineColor

Color used to draw the lines connecting dependent nodes in a tree. Default is black.

NodeColor

Color used to fill an ordinary node of the tree. Default is yellow.

NodeOutlineColor

Color used to draw the outline of an ordinary node. Default is black.

HiddenNodeColor

Color used to draw nodes marked as hidden, if shown. Default is black.

7.2. Other options affecting tree appearence

HighlightWindowWidth

Width of the frame drawn around the focused view.

LineWidth

Width of the lines connecting dependent nodes in a tree.

NodeWidth

The horizontal diameter of the elipsis representing a node in a tree.

NodeHeight

The vertical diameter of the elipsis representing a node in a tree.

CurrentNodeWidth

The horizontal diameter of the elipsis representing the active node in a tree.

CurrentNodeHeight

The vertical diameter of the elipsis representing the active node in a tree.

NodeXSkip

The minimal horizontal distance between two nodes in a tree.

NodeYSkip

The minimal vertical distance between two nodes in a tree.

XMargin

Horizontal amount of space left around borders of the box surrounding the text of displayed attributes of a node.

YMargin

Horizontal amount of space left around borders of the box surrounding the text of displayed attributes of a node.

BaseXPos

The horizontal distance of the tree root (zero's node) from the right of the tree view.

BaseYPos

The vertical distance of the tree root (zero's node) from the top of the tree view.

DrawBoxes

If this option is set, TrEd starts with the View->DrawBoxes menu item checked.

HighlightAttributes

If this option is set, TrEd starts with the View->Highlight Attributes menu item checked.

ClearBackground

Choose if invisible rectangles should be drawn beneath text labels to clear the background for the text. Possible values are 0 and 1.

AllowCustomColors

This option takes one of the values 0 and 1. If set to 0, all references to custom colors in attribute patterns are ignored. It is also the default value.

ShowHidden

If this option is set, TrEd starts with the View->Show Hidden Nodes menu item checked.

HintWait

This option controls the length of the time interval between user points a node with a cursor mouse and to when TrEd displayes the floating hint for the node. The value is to be given in milliseconds. See Section 5. for more information about defining the content of the hints.

SearchMethod

This option lets you define the default method used when searching with the Node->Find command. The default value is Exhaustive regular expression but user may use any of the following values (actually only the first letter suffices):
Regular Expression
Wildcards
Literal
Exhaustive regular expression

MacroListOrder

This option defines the default ordering of macros when View->List of Named Macros... menu command is used. Possible values are letters M (sort by macro menu label) and K (sort by keyboard shortcuts assigned to macros). Default value is M.

MaxDisplayedValues

This option may be used to tell TrEd how many fields should fit in one screen of a list when a dialog displaying possible (or already assigned) values for a certain attribute is displayed. (The greater the number is, the taller the dialog grows).

MaxDisplayedAttributes

This option may be used to tell TrEd how many fields should fit in one screen of the Edit Node Attributes and Find Node by Attributes dialog windows. (The greater the number, the taller the dialogs).

7.3. GUI options

AppName

The window title for the TrEd's main window.

AppIcon

TrEd's desktop and window icon (in XPM format).

ButtonsRelief

Style of the relief of the GUI buttons. Possible values for this option are: raised, sunken, flat, ridge, solid, and groove. Default is 'raised'.

ButtonBorderWidth

Width of the borders of GUI buttons. Default is 2.

MenubarRelief

Style of the relief of the GUI menu-bar. Same values as for ButtonsRelief option are possible. Default is 'raised'.

MaxMenuLines

Maximal number of User-menu lines. If more lines in the menu should appear, a submenu is created as a last item, in which the menu continues.

SortAttributes

If 1, all lists where attribute names or values are displayed are sorted alphabetically. Otherwise the order given in the FS-file header is preserved. Default value for this option is 1.

CreateMacroMenu

If this option is 1, TrEd creates a special menu Key-macros where all defined macros which are assigned a key are presented also as menu functions.

StrictMotif

If this option is 1, strict motifish look and feel is used in TrEd's GUI.

7.4. Fonts

Font

Font used to display the text of attributes and also in several other places of GUI where the text of attributes is displayed or edited. There are two possible formats of values for this option:

  1. Standard X font-spec, with possible wildcards, e.g.: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-2

  2. Font attribute-oriented format, which is a comma-separated list of pairs of the form font-attribute:value. The attributes are: family, size, weight, slant, underline, overstrike. Family is a font-family name like Arial, Helvetica or Times New Roman. Size is a number providing the font-size in points (i.e. not pixels!). Possible values for bold are normal and bold, possible values for slant are roman and italics. The underline and overstrike attributes take just boolean values of 1 and 0. If a font, that would match the specified attributes exactly, is not found, the most similar font is used.

    Example
    Font = family:Arial,size:10,weight:bold

VLineFont

Font used for displaying the text in the value line above tree. The same formats as for Font are allowed for this option. If not specified, Font is used.

7.5. Printing options

PsFontFile

A pfa-file with a PostScript font to be used for printing.

PrintColors

If 0, TrEd prints in black and white. If 1, TrEd uses the same colors for printing as it does for displaying the tree on the screen. This option may be overriden by the Use Colors check-box in the Print dialog.

PsFontName

A Postscript font name to be substituted by the font given in PsFontFile in the final PosctScript.

PsFontSize

Size of the Postscript font to be substituted by the font given in PsFontFile in the final PosctScript.

PrtFmtWidth

Width of the paper used for printing. Append one of the characters i,c,m to the number to destinguish the dimension (inches, centimeters, milimeters respectively).

PrtFmtHeight

Width of the paper used for printing. Same format as PrtFmtWidth.

PSMedia

A PostScript document media-type identifier to be used in the header of the printed PostScript. The default value is %%DocumentMedia: A4 595 842 white()

PSFile

The default name of the output file when printed to file. This name may be modified in the Print dialog.

MaximizePrintSize

If this option is on (i.e. 1), TrEd tryes to draw the tree as big as to fill the whole paper. Default is 0 here.

7.6. Miscelaneous options

LibDir

This option forces TrEd to search for its library files in the specified directory.

MacroFile

Path to a file with macros for TrEd.

DefaultMacroFile

Path to a file with the default set of macros for TrEd.

UseCzechLocales

If 1 is set here, TrEd uses Czech locales for handling text. This may be especially useful in macros.

Sgmls

This option may be used to provide a path to an SGML parser with support for ESIS output, such as James Clark's SGML parser nsgmls. TrEd may then use this parser to read SGML CSTS files (used e.g. in the Prague Dependency Treebank 1.0).

SgmlsOpts

This option may be used to provide additional parameters to the SGML parser declared in Sgmls option. By default, this option is set to -i preserve.gen.entities. These parameters forces James Clark's nsgmls parser to include a part of CSTS DTD where all global entities are re-declared in such a way that they expand to themselves literally and thus are preserved (as if no expansion was done).

CSTSDoctype

This option should point to a file containing CSTS doctype declaration combining both the SGML subset declaration as well as the CSTS DTD. This file is included in the distribution of TrEd and is by default stored in TrEd's library directory as csts.doctype. Setting this option overrides this default.

gzip

This option may be used to point TrEd to a GNU gzip command, which may be used for transparent saving files commpressed by GNU gzip. The default value is /bin/gzip -c if /bin/gzip exists and is executable. Otherwise the value is undefined and TrEd does not support transparent saving GNU-zipped files.

zcat

This option may be used to point TrEd to a GNU zcat command, which may be used for transparent opening files commpressed by GNU gzip. (These files are recognized by the .gz suffix.) The default value is /bin/zcat if /bin/zcat exists and is executable. Otherwise the value of gzip option is used.