Any environment variable may appear in the description file, for evaluation and substitution when the line is parsed. Environment variables are denoted by prefixing them with a $ symbol, just as in any shell script. A variable name is considered to continue until the next whitespace; where this would lead to an incorrect name being searched for, it may be bracketed by {}, ie.
f.mail-box "$USER %d" ${HOME}/Mail
f.mail-box "vanye %d" /home/vanye/Mail
Here $USER is terminated by a space, whereas $HOME isn"t, hense the need to enclose it in {}.
There area number of options that may be applied to enhance or otherwise affect a specific entry in a menu or panel. Options are included in square brackets ([]) after the label (and before anything else on the line), whitespace is used to separate multiple options inside the [].
Not all options are available on every entry, see the entry for details of those allowed.
This entry has some help text, called name associated with it. The help text may be either plain ascii of HTML text.
This entry has a help file associated
with it. The file may contain either plain, formatted text or HTML
source, and the appropriate browser will be selected (to be
interpreted as HTML a file must have <
as its first
character). If no file is specfied, then a file with the same name as
the first word in the entries label will be searched for. The file
must not be fully specifed, it will be seached for in the directory
list gived by the X-resource helpFilePath.
Specifies an X bitmap (or alternatively if colour icons are supported---X pixmap) file to be used instead of the text label for the entry. The file will be searched for in the directory path specified in iconFilePath.
Limits the number of times this entry may be executed. Once this limit is reached, trying to run anymore will be ignored and a message will be displayed.
Specifies a time, in minutes (or seconds if the number is suffixed with s).
Specifies a default. this is only used inside panel definitions. The cmd should be the actual default, not the name of the default.
For an example of the syntax in use, see Appendix Annotated Example of Description Syntax .
Starts a menu definition, called menu name. Any number of entries may appear between this and the corresponding EndMenu. Note: the effect of starting another menu before finishing the first is undetermined (ie. don"t do it).
Adds the following entries (until the next EndMenu) to the menu menu name. If menu name hasn"t already been defined the results are unspecified (that well known euphamism for "will probably crash").
Ends a menu definition started with Menu or AddToMenu.
Creates a button in the
current menu. The button will be labeled cmd
.
Relevent options: H, F, I, N, T.
If the T option is specified, this will display a dialog informing the user that the command has been started and to please wait. After the time expires the dialog will be destroyed.
Creates a
button (labeled
Relevent options: H, F, I.
Creates a simple label. This can be used as a title in a pulldown menu.
Relevent options: I.
Creates a separator.
Creates a button (labeled
Relevent options: H, F, I.
These are the basics, others (optional) are discussed on a package-by-package basis in the next section.
This is a simple package that provides visual feedback when new mail arrives, ala biff. Any number of mailboxes can be watched (although read access is requred), with differing frequencies of checking for new mail.
When new mail does arrive the mail-box label is flashed at an increasing rate.
Creates a
button (labeled %d
), ie "$USER~%d"
, would display as
something like "vanye~27"
(if I had 27 messages in my
mailbox).
If the time option is set, the mail box is only checked when the period expires. If no time option is explicitly set the file is checked only every 15minutes.
If the mail box is selected, the number of messages is re-counted there and then, without waiting for the next timed update.
Relevent options: H, F, T.
This package displays the amount of free disk space, colour coded, of a specified partition. The colours are specified on the line (and are therefore specific to that one instance of the disk space watcher.
Calculates
the free space in the partition (in Mbyte), and displays it
in the label (which should have a place holder marked by
%g
).
The text string is coloured depending on the free space and the break points specified in max and min. Perhaps the easiest way to explain is through an example:
f.disk-space "%.4gMb in /" / green=:5 yellow=5:3 orange=3:1 red=1:
If one of max or min is not specified then it is taken to be infinity (positive if the max is missing, negitive if the min is missing).
If an optional time is not specified, the values are updated every 30 minutes.
If the label is selected, the disk space is re-calculated, without waiting for the next timed update.
Relevent options are H, F, T.
The clock (or rather the reminder) has been considerablt enhanced in this version, it is now possible to save reminders between invocations of rTc in a reminder file.
The label string is used to
format the display via the strftime(3)
library function. This
allows place holders to be put in the label, and these will be
substituted for when it becomes time for the label to be updated. The
actual place holders are likely to be system dependent, but the more
common ones are below:-
Place HolderMeaning
%H
The hour (24 hour clock)%I
The hour (12 hour clock)%M
The minute%S
The second%p
Either "am" or "pm"If the clock is selected, a reminder pop-up will appear. This panel is spilt into four main sections:- the date/time section; the reminder action area; a list of all reminders; and an area for the entry of the reminder text.
->
. This adds the reminder to
the list.OK
to save the new reminders.
Del.
.OK
to update the reminder file.
<-
. This loads the reminder
into the date/time and message fields.->
. This updates the
reminder in the list.OK
to save the new reminders.The help system now encompasses two means of describing the message (files and embedded text), and two formats of text (HTML and plain formatted ascii). A context---sensitive option is provided as well as the facility to hand-craft a help menu (and add any number of entries to it).
Two browsers are available, one for plain formatted text, the other
(optional) for HTML text. The actual one used is determined by whether the
first character of the text is <
The HTML viewer is not meant to replace Mosaic, it can only read files via NFS, only GIF pictures may be embedded, the spawning of external viewers is not supported, and it does not store a history of files it has viewed, so movement betwen pages has to be written into the pages themselves.
This has
the same syntax (ans effect) as f.menu
, the only difference
is that the Motif style guide will be followed by making the menu
button appear on the right hand side of the menu-bar. An extra feature
has been built in, if you request context sensitive help for this
button, a copyright panel with configuration information (indicates
which options are supported) will be dispalyed.
Valid options are H, F, I.
Creates a button in the current menu, that, when selected will start the context sensitive system: the mouse cursor will change shape; an object should be selected (ie. clicked on); any help registered for that object will be displayed.
To obtain context help for an object that is not immediately visible (ie. in a menu not currently poped-up), give the object keyboard focus and press the help key (this is usually F1).
Creates a button that when selected displays the help stored in the help object name. See HelpText/EndHelp for more details.
Valid options are H, F, I.
Creates a
button (labelled
Valid options are H, F, I.
Starts reading the file and storing the text as the object named name. Reading will only be terminated by the word EndHelp appearing at the beginning of a line.
Ends a help text definition started with HelpText.
This is the largest of all the optional features, purely because of the number of new keywords added to the description syntax.
Starts a panel definition, called name.
Ends a panel definition previously started with Panel.
Creates a
button in the current menu, (labeled
This will be the command executed
when the Execute
button (located at the bottom of the panel)
is pressed. The string cmd may contain both environment
variables (denoted by $name) and rTc variables
(denoted by @name). An rTc variable may only be set
by another object in the same panel.
The command object is never seen, it is simply a convenient metaphor for storing information accessed by the rest of the panel.
Creates
a text entry object in the current panel, the string
Creates
a file selector with a prompt
The file selector comprises: a scrollable list of files, a text entry (so new filenames may be entered) and a directory label. In the list of files, files are represented by a light font, directories by a bold one. Note: This is a brand new Motif Widget, there may be some problems with it, see Appendix optional-features for more details.
Creates a scale setting the current value to the rTc variable name. The scale ranges between min and max in steps of incr (only via the keyboard). If none of these are specified the defaults are 0, 100, 1 respectively.
Creates a list containing item 1, item 2 etc and setting name to be the currently selected item. Only one item may be selected at any time.
Creates a series of toggles (only one of which may be set at any time). Each toggle will be labelled with the correspoding label, and when set, the rTc variable name will be set to the respective cmd.
When it comes time to execute a command, the shell given by the
environment variable SHELL
is used (rather than forcing all
comands through sh. Of course if SHELL
is not set,
then there is no choice, but to hope that /bin/sh is
available.
If the msgLevel has been set to Information (this requires userType to be Expert), then any output generated by the executed program is captured and presented to the user. either via the status area or dialogs as required.
Next Chapter, Previous Chapter
Table of contents of this chapter, General table of contents
Top of the document, Beginning of this Chapter