home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!morrow.stanford.edu!sep!steve
- From: steve@sep.Stanford.EDU (Steve Cole)
- Newsgroups: alt.sources
- Subject: xtpanel 2.0 - interactive program builder - part 07/10
- Followup-To: alt.sources.d
- Date: 21 Nov 1992 00:33:28 GMT
- Organization: Stanford Exploration Project
- Lines: 1623
- Distribution: world
- Message-ID: <1ek04oINN194@morrow.stanford.edu>
- NNTP-Posting-Host: taal.stanford.edu
-
-
- Submitted-by: steve@sep.Stanford.EDU
- Archive-name: xtpanel/part07
-
- #!/bin/sh
- # This is part 07 of a multipart archive
- # ============= xtpanel/xtpanel.man.sed ==============
- if test ! -d 'xtpanel'; then
- echo 'x - creating directory xtpanel'
- mkdir 'xtpanel'
- fi
- if test -f 'xtpanel/xtpanel.man.sed' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/xtpanel.man.sed (File already exists)'
- else
- echo 'x - extracting xtpanel/xtpanel.man.sed (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/xtpanel.man.sed' &&
- .TH XTPANEL l "19 November 1992"
- .SH NAME
- xtpanel \- build an interactive program, from the command line
- or using a simple scripting language
- .SH SYNOPSIS
- \fBxtpanel\fP [-help] [-tty] [-cpp] [cpp_args] [-file script_file]
- [-message] [-text] [-dialog] [-button] [-toggle] [-slider] [-scrollbar]
- [-choice] [-list] [-menubutton] [-graph] [-var] [-quit] < script_file
- X
- .SH DESCRIPTION
- X
- \fIxtpanel\fP provides a quick and easy way of producing a panel
- containing interactive objects such as buttons, sliders, and text
- fields, either from the command line or from an xtpanel script file.
- Each panel object maintains a string representation of its value. When
- the object is modified it updates its value and it can also perform one
- or more actions such as printing its value or calling a system command.
- Objects can make use of the values of other objects in constructing their
- actions and they can set the values of other objects as the result of
- an action. The result is an interactive X windows program, without the
- need for conventional programming.
- X
- .PP
- X
- Three utilities are provided with xtpanel. The first is a script
- generator. This is a collection af xtpanel scripts that can be used to
- generate, examine and test xtpanel script files. It is invoked using
- the command \fIxtpanel-generator\fP. The second utility is a
- collection of example scripts and a master script that can be use to
- view and run the examples. It is invoked using the command
- \fIxtpanel-examples\fP. A particularly powerful demo is the "lister"
- script example, which is a tool for maneuvering through a Unix
- filesystem and viewing files at any level. The third is a set of
- xtpanel scripts that present information about xtpanel, mostly taken
- from this manual page, in an interactive, menu-driven form. This
- is invoked by doing \fIxtpanel -help\fP.
- X
- .SH OBJECT TYPES
- xtpanel supports the following objects:
- X
- .IP message 10
- Displays a single line of text.
- X
- .IP text 10
- Displays multiple lines of text in a scrollable area. Can be read-write
- or read-only.
- X
- .IP dialog 10
- Provides an editable text field, with a label and an OK button.
- X
- .IP button 10
- A single button.
- X
- .IP toggle 10
- A button that can be toggled between two states.
- X
- .IP slider 10
- Allows the user to choose a value from a range of integer
- or floating point values.
- X
- .IP scrollbar 10
- Similar to a slider, but simpler in appearance.
- X
- .IP choice 10
- A group of buttons, only one of which may be selected at a time.
- X
- .IP menubutton 10
- A button with a menu attached.
- X
- .IP list 10
- A list of character strings, only one of which may be selected at a time.
- X
- .IP graph 10
- An object containing a number of scrollbars, each of which controls
- the value for one sample of a list of numbers.
- X
- .IP var 10
- A variable that has no screen representation but stores a value.
- X
- .PP
- In addition there are several objects that group
- other objects together in boxes. Grouping objects in this
- way allows greater control of the panel layout. See
- the section below on BOXES.
- X
- .SH CONTROLLING XTPANEL
- The rest of this manual page describes
- how to write xtpanel script files or run xtpanel from the command
- line. If you just want to use it, and don't want to write script
- files or learn the command line syntax, then run the automatic
- script generator described above. The generator is also a good
- way to learn about the script language, since it allows you to
- view, edit, and test a script file as it is being built.
- X
- .SH SCRIPT VS. COMMAND LINE
- The typical xtpanel script contains lines of the form:
- X
- .br
- object_type={ parameter1=value1 parameter2=value2 ... }
- X
- .br
- This format is very flexible; the parameters can be supplied in
- any order, or omitted and defaults will be provided. Line breaks can
- occur anywhere.
- .PP
- XFrom the command line, all objects and all their parameters must
- be specified on the same line in a precise order:
- X
- .br
- -object_type value1 value2 value3... -object_type value1 ...
- X
- .PP
- Some parameters can be omitted; the "-" on the beginning
- of the next object tells xtpanel to stop reading parameters
- for one object and begin the next. However, in order to
- specify a particular parameter, all those up to it in the
- sequence must be specified. (For instance, in the case above,
- to specify value3 for the first object, one must also specify
- value1 and value2, while in a script they could be omitted and left to
- default.)
- .PP
- For these reasons, and because the command line format
- (where the entire panel is specified on a single line)
- is more difficult to read, it is recommended that a script file be
- used for all but the smallest examples. The following section
- describes the objects in greater detail, along with the
- script language syntax. If you wish instead to use the
- command line interface, see the COMMAND LINE SYNTAX
- section below.
- .PP
- Note that scripts and the command line interface can be mixed, and multiple
- script files can be read using the "-file" option (see GENERAL COMMAND
- LINE OPTIONS, below.) So the following is a valid xtpanel command:
- .br
- xtpanel <script1 -file script2 -quit.
- X
- .SH DESCRIPTION OF OBJECTS AND SCRIPT SYNTAX
- Here is a more detailed description of the objects,
- the parameters relevant to each, and the syntax for
- building these objects in a script file.
- X
- The general format for specifying an object in a script file is:
- X
- .br
- object_type={ parameter=value ... }
- X
- Note that no spaces are allowed between
- the object_type and the "{".
- X
- Each "value" can take one of four forms:
- A single word, a string enclosed in single quotes, string enclosed in
- double quotes, a system command enclosed in backquotes. See the section
- "SCRIPT SYNTAX DETAILS" for more information on the syntax.
- X
- .PP
- There are four parameters that many objects have in common, these are:
- name, label, action and value.
- X
- \fIname\fP is the name of the object.
- The name serves two purposes, it can be referred to by other objects who wish
- to obtain the or modify the string representation of the object.
- X
- The name can also be used in modifying the appearance of an object using
- the X-toolkit resource mechanism.
- X
- When names are referred to by other objects they start with a dollar sign and
- optionally an opening brace. They are assumed to end at
- the next space or closing brace. Therefore a name may not contain spaces,
- braces or dollar signs.
- X
- \fIlabel\fP is the label that appears on the object. By default it
- is the set to the name. It will appear in an "appropriate" place
- which depends on the object type. Some objects do not have labels, the
- label parameter is ignored for these objects.
- X
- \fIvalue\fP is the initial string value associate with the object.
- If the object is modified this string value will change. It defaults to
- be the same as label.
- X
- \fIaction\fP is an action that occurs when the button is pressed.
- Defaults to "NONE", which means that the button simply maintains a
- string, containing its value, for use by other objects. Other actions
- are PRINT (print string to standard output), SYSTEM (execute a
- command), STRING (reformat the internal representation of the object's
- value, where the string can contain more than just the object's value)
- , ASSIGN (set another object's value to a given string), SET (set an
- attribute of an object; e.g. color ) and QUIT (quit xtpanel).
- See the section below on ACTIONS for more
- details. If more than one action is present the actions will be performed
- in the order that they are specified.
- X
- .IP \fImessage\fP 3
- A message displays a single line of text on a panel.
- Messages are used to give short instructions or bits of
- information to the user. The script syntax for a message is:
- X
- .br
- message={ value=.... name=.... }
- X
- The most important variable in a message object is the \fIvalue\fP.
- The value is the text that is displayed on the screen.
- The \fIname\fP is relevant for tailoring the appearance of
- this message object using resources or assigning new values to the
- message. If a new value is assigned to the message the text will change
- to reflect the new value.
- X
- .br
- example:
- .br
- message={ value=" hello world, I am a message object " }
- X
- Assigning a new value to a message object (using an ASSIGN
- action) will change the text that is displayed.
- X
- .IP \fItext\fP 3
- A text object displays any number of lines of text in
- a multi-line scrollable region.
- X
- .br
- text={ action=... name=.... value=... editType=... }
- X
- The \fIvalue\fP is the text to be displayed on the screen.
- Newlines in the value will cause the text to start a new line.
- The \fIname\fP is relevant for tailoring the appearance of
- this text object using resources or assigning new values to the
- message. If a new value is assigned to the text the text will change
- to reflect the new value.
- \fIeditType\fP is used to select whether editing of the text
- is allowed. Choices are read (read-only), append (can add to text
- but not modify existing text), edit (read-write).
- X
- Assigning a new value to a text object will change the text
- that is displayed.
- X
- .br
- examples:
- .br
- text={ value="I am a multiline \\n text object \\n with three lines" }
- .br
- text={ value=`cat README` }
- X
- .IP \fIdialog\fP 3
- A dialog displays an editable line of text. Syntax:
- X
- .br
- dialog={ label=... value=... name=... action=... }
- X
- \fIname\fP defaults to "dialog1", "dialog2" etc.
- \fIlabel\fP appears above the text field.
- \fIvalue\fP is the text that initially appears in the text field.
- A value of "" means that the text field will initially be blank.
- \fIaction\fP: An "ok" button is added to the
- panel, and the dialog object is activated when this button is
- pressed.
- X
- Assigning a new value to a dialog changes the displayed string
- to the new value.
- X
- .br
- example:
- .br
- dialog={ label="Filename to edit" value="" action="xterm -e vi $val" }
- X
- .IP \fIbutton\fP 3
- Button is the first of the interactive objects. Pressing
- the button will cause a specified action to take place.
- X
- .br
- button={ label=... value=... name=... action=... }
- X
- \fIname\fP defaults to "button1", "button2" etc.
- \fIlabel\fP is the text that appears on the button.
- \fIvalue\fP is the string value associated with the button.
- \fIaction\fP is an action that occurs when the button is pressed.
- X
- Assigning a new value to a button does not change the appearance of the
- button but it will change the value used in an action.
- X
- .br
- example:
- .br
- button={ label="Press me" action="PRINT Aargh! I was pressed" }
- X
- .IP \fItoggle\fP 3
- A toggle object is similar to a button except that it
- can be toggled between its on (highlighted) and off states,
- while a button returns to its off state immediately. The
- value of a toggle object is blank when the toggle is in
- its off state.
- X
- .IP \fIslider\fP 3
- A slider lets the user choose a value from a range of integer
- or floating point values. Syntax:
- X
- .br
- slider={ label=... value=... name=... action=... min=... max=... \
- format=... width=... height=... }
- X
- A slider object has a label, a slider and a text field that
- displays the current slider value, and
- an "OK" button to allow the user to trigger the slider's
- action.
- X
- \fIname\fP defaults to "slider1", "slider2" etc.
- \fIlabel\fP appears above the slider.
- \fIvalue\fP is the starting value for the slider; defaults to the minimum.
- \fIaction\fP: For action types SYSTEM and PRINT the action occurs when
- the "ok" button is pressed. For action type STRING the action occurs when
- the slider position changes.
- X
- Assigning a new value to a slider changes the slider position to match the
- new value. If the new value string is not a number (as intepreted by the
- routine atof() ) the slider will be set to zero.
- X
- \fImin\fP is the minimum value for the slider; defaults to 0.
- \fImax\fP is the maximum value for the slider; defaults to 1.
- X
- \fIformat\fP is the format with which the slider label and its internal
- string
- will be printed. The slider value is stored internally as a floating point
- number; the default value for format is %f, which prints the value
- with five decimal places. You can specify a different format, according
- to the format specification for the C programming language. To obtain
- in integer-only slider, use a format of %.0f (the 0 indicates no digits
- after the decimal point).
- X
- \fIwidth\fP and \fIheight\fP are the lengths of the major and minor
- axes of the slider. By default, sliders are oriented horizontally.
- This can be changed by using the orientation parameter described
- below in the MISCELLANEOUS PARAMETERS section.
- X
- .br
- example
- .br
- slider={ label=Velocity min=1000 max=4000 value=2000 format=%4.0f }
- X
- .IP \fIscrollbar\fP 3
- A scrollbar object is similar to a slider, except that it has
- no label or ok button. A scrollbar's actions are performed
- whenever the scrollbar is changed.
- X
- .IP \fIchoice\fP 3
- A choice object is a set of toggle buttons. Each button may
- be set on or off, but only one button may be active at a time. Syntax:
- X
- .br
- choice={ label=... value=... name=... action=... item=... itemlist=... }
- X
- The choice object consists of a text label and a set of buttons.
- The value of the object on output is set to the value associated with
- the active button.
- X
- \fIname\fP defaults to "choice1", "choice2" etc.
- \fIlabel\fP appears adjacent to the buttons.
- \fIvalue\fP is the initial value associated with the
- choice. It must match the value of one of the buttons, or by default
- it is set to the value of the first button.
- \fIaction\fP is an action that occurs when a button is pressed.
- X
- Assigning a new value to a choice changes the choice to match the new
- value. If the new value does not match any item's value the choice will be
- unchanged.
- X
- \fIitem\fP and \fIitemlist\fP are used to describe the buttons
- contained in a choice. You can either specify buttons one at a
- time with item, or in groups with itemlist. See the detailed
- descriptions of item and itemlist below. There is no limit on
- the number of items or itemlists used in a choice object.
- X
- .br
- example:
- .nf
- choice={ label="english colors" action="PRINT use $val "
- X item={ label=red } item={ label=green } item={ label=blue }
- X }
- .fi
- X
- .IP \fImenubutton\fP 3
- A button with a pulldown menu. Syntax:
- X
- menubutton={ label=... value=... name=... action=... item=... itemlist=... }
- X
- \fIname\fP defaults to "menubutton1", "menubutton2" etc.
- \fIlabel\fP appears on the button.
- \fIvalue\fP is the initial value associated with the menu.
- It must match the value of one of the menu items, or it
- defaults to be the same as the value of the first menu item.
- \fIaction\fP occurs when a menu item is selected.
- X
- \fIitem\fP and \fIitemlist\fP are used to describe the options
- contained in a menu. You can either specify buttons one at a
- time with item, or in groups with itemlist. See the detailed
- descriptions of item and itemlist below. There is no limit on
- the number of items or itemlists used in a menubutton object.
- X
- Assigning a new value to a menubutton changes the menubutton to match
- the new value. If the new value does not match any item's value the
- menubutton will be unchanged.
- X
- .br
- example
- .nf
- menubutton={ label="french color" action="PRINT utilisez $val "
- X item={ label=red value=rouge }
- X item={ label=green value=vert }
- X item={ label=blue value=bleu }
- X }
- .fi
- X
- .IP \fIlist\fP 3
- A list of items; the user clicks on one of the items to select it.
- Syntax:
- X
- .br
- list={ label=... value=... name=... action=... item=... itemlist=... }
- X
- The list object has a text label and a list of items.
- X
- \fIname\fP defaults to "list1", "list2" etc.
- \fIlabel\fP appears adjacent to the list.
- \fIvalue\fP is the initial value associated with the list. It must
- match the value of one of the list items, or it defaults to be
- the same as the value of the first list item.
- \fIaction\fP occurs when an item is selected.
- X
- \fIitem\fP and \fIitemlist\fP are used to describe the items
- contained in a list. You can either specify items one at a
- time with item, or in groups with itemlist. See the detailed
- descriptions of item and itemlist below. There is no limit on
- the number of items or itemlists used in a list object.
- X
- Assigning a new value to a list changes the list value to match the new
- value. If the new value does not match any item's value the list will be
- unchanged.
- X
- .br
- example:
- .nf
- list={ label="german color" action="PRINT benutze $val "
- X item={ label=red value=rot }
- X item={ label=green value=gruen }
- X item={ label=blue value=blau }
- X }
- .fi
- X
- X
- .IP \fIitem\fP 3
- Item is used to specify a single item for a choice, menu or list.
- Syntax:
- X
- .br
- item={ label=... value=... }
- X
- \fIlabel\fP is the label that appears on the screen,
- as the name of the button (for choice) or on the menu or list.
- Defaults to "item1", "item2" etc.
- \fIvalue\fP is the value that is set in the parent object when this
- item is selected. Defaults to be the same as label.
- Item is preferred over itemlist when the text displayed
- on the screen for an item and that used for its value differ.
- X
- .br
- example:
- .br
- item={ label=Two value=2 }
- X
- .IP \fIitemlist\fP 3
- Itemlist is used to specify several items for a choice, menu or list.
- Syntax:
- X
- .br
- itemlist={ list=... separator=... }
- X
- \fIlist\fP is a single string containing a list of items. The string
- will be parsed to obtain the individual items. The label and value
- of each item will be the same, set to the string taken from the list.
- Thus itemlist is not appropriate when the text displayed on
- the screen for an item (the label) and that used for the value
- are to differ.
- \fIseparator\fP is a string of characters that is used to separate different
- items in the list string. Defaults to separator=" " (the blank character.)
- X
- .br
- examples:
- .nf
- itemlist={ list="red white blue" }
- itemlist={ list=`ls -aF` separator=" \\n" }
- .fi
- X
- .IP \fIgraph\fP 3
- A graph is a composite object, made up of a number of scrollbars.
- Syntax:
- X
- .br
- graph={ nsamp=... label=... value=... name=... action=... min=... max=... \
- format=... width=... height=... }
- X
- A graph object has a label, and \fInsamp\fP scrollbars, each of
- which sets the value of one sample in the graph. The value of
- a graph is a string containing the sample values, separated by
- spaces.
- X
- \fInsamp\fP number of samples in the graph.
- \fIname\fP defaults to "graph1", "graph2" etc.
- \fIlabel\fP appears above the graph.
- \fIvalue\fP is the starting value for the graph; defaults to the minimum.
- You can specify up to nsamp values in a blank-separated list. If
- you specify fewer than nsamp, the last value specified is re-used
- as needed. Thus you can use value=0 to set all samples to zero.
- \fIaction\fP: Graph objects cannot do PRINT or SYSTEM actions by
- themselves. You must supply another button that uses the graph's
- value to perform an action.
- X
- \fImin\fP, \fImax\fP, and \fIformat\fP are the same as for sliders.
- X
- \fIwidth\fP and \fIheight\fP are the lengths of the major and minor
- axes of the scrollbars in the graph. These are the dimensions of
- each scrollbar, not the graph as a whole.
- X
- By default, the scrollbars are oriented horizontally.
- This can be changed by using the orientation parameter; see the
- MISCELLANEOUS PARAMETERS section below.
- X
- Assigning a new value to a graph will change the value of
- the samples. You can specify up to nsamp values in a blank-separated list.
- If you specify fewer than nsamp, the last value specified is re-used
- as needed.
- X
- Holding down the meta key while the cursor is inside a graph object
- allows the user to "draw" the graph without having to press mouse
- buttons. This drawing can be slow for graphs with a large number
- of samples, because of the number of widgets involved.
- X
- .br
- example
- .br
- graph={ nsamp=100 label="A(t)" min=-100 max=100 value=0 format=%4.0f }
- X
- .IP \fIvar\fP 3
- Var is an object that has a value and no screen representation.
- X
- Syntax:
- var={ name=... value=... }
- \fIname\fP defaults to "var1", "var2" etc.
- \fIvalue\fP is the value of the var.
- X
- X
- Variables can be used for adding arbitrary arguments on the command line.
- See the command line syntax below. The values of var objects may be used
- in the action of other objects so that an xtpanel's behaviour can be
- modified without changing the script file. Also the value of a var may be
- changed by the ASSIGN action. Thus a var can be used to pass
- information from one object to another.
- X
- .SH MISCELLANEOUS PARAMETERS
- In addition to the parameters described above, there are a number
- of general parameters that apply to many objects that customize
- the appearance of the object. These are listed below, along with
- a list for each of the objects it can be applied to. These
- general parameters can also be modified by xtpanel using the SET
- action. See the section on ACTIONS.
- X
- .IP height 10
- height of object, in pixels.
- .IP width 10
- width in pixels. Height and width can be used for most objects.
- .IP foreground 10
- foreground color. Colors are appropriate for most object types.
- .IP background 10
- background color
- .IP borderColor 10
- border color.
- .IP font 10
- text font. Appropriate for message objects only.
- .IP orientation 10
- for boxes, scrollbars, choice objects. Choices are horizontal and vertical.
- .IP bitmap 10
- for message, button, and toggle objects. Specify a file name.
- The bitmap will be displayed in place of the label.
- .IP editType 10
- for text objects only, to indicate whether they are read-only
- are not. Choices are read (read-only), append (can add to text
- but not modify existing text), edit (read-write).
- X
- These parameters are just some of the many resources defined
- for Athena widgets. In the future we hope xtpanel will provide
- a more general method that allows the user to access all
- resources, not just those on this list.
- X
- .SH SCRIPT SYNTAX DETAILS
- The general format for specifying an object in a script file is:
- X
- .br
- object_type={ parameter=value ... }
- X
- Note that no spaces are allowed between
- the object_type and the "{".
- X
- A line with an exclamation "!" in column one is treated as a comment line,
- the rest of the line will be ignored.
- X
- Each "value" can take one of four forms:
- X
- .IP 1) 3
- A single word.
- .br
- e.g. label=fred
- X
- .IP 2) 3
- zero or more words enclosed in single quotes
- .br
- e.g. label='fred in quotes'
- .br
- The quotes are stripped before the value is stored. Two consecutive
- single quotes within the quotes will produce a single quote in the
- stored value. Any other type of quotes pass through unchanged.
- .nf
- e.g. ' ''fred'' is happy' is stored as -> 'fred' is happy<-
- X '"fred" is happy' is stored as ->"fred" is happy<-
- .fi
- X
- .IP 3) 3
- zero or more words enclosed in double quotes
- .br
- e.g. label="fred in quotes"
- .br
- The quotes are stripped before the value is stored. Two consecutive
- double quotes within the quotes will produce one double quote in the
- stored value. Any other type of quotes pass through unchanged.
- .nf
- e.g. " ""fred"" is happy" is stored as -> "fred" is happy<-
- X " ""fred"" is 'happy'" is stored as -> "fred" is 'happy'<-
- .fi
- Within either single or double quotes the following transformations are
- applied to handle newlines:
- .br
- .nf
- X newline -> newline
- X backslash newline -> is removed
- X \\n -> newline
- .fi
- X
- .IP 4) 3
- zero or more words enclosed in backquotes.
- .br
- e.g. label=`echo my name is fred`
- .br
- The value stored is the output produced by running the command using
- the user's shell. Any trailing whitespace is stripped from the output.
- .br
- In this example the value stored is ->my name is fred<-
- X
- Note the special case of a backquoted string within a quoted action.
- See actions below.
- X
- .SH ACTIONS
- An action is a command performed when a user interface object has changed
- its state. e.g. a button is pushed, a list item is chosen, a slider is
- moved. If more than one action is specified for an object then the separate
- actions are performed in the order in which they are specified in the script
- file.
- X
- There are seven basic types of action NONE, QUIT, SYSTEM, PRINT, STRING,
- ASSIGN, and SET.
- X
- If no action is specified (or the action is specified as "NONE")
- the action type is NONE. In this case an object
- will just maintain its string representation. For dialogs, the string
- is the contents of the text field; for sliders, the slider value;
- for choice, menubutton and list objects, the value associated with
- the selected item. When an object with action=NONE is modified,
- its string is kept up to date, but nothing else happens.
- X
- An action type of QUIT, specified as ACTION=QUIT, will cause the xtpanel
- program to quit when the object is interacted with. The simple quit button
- is written as:
- .br
- button={ label=QUIT action=QUIT }
- X
- The next four action types (SYSTEM, PRINT, STRING and ASSIGN) are more
- complicated. Each uses the format specified in the action command to
- generate a string.
- If the action is SYSTEM, then that string is executed. If the action type
- is PRINT then the string is printed to the standard output. If the action
- is STRING then the string is stored as the internal string representation
- of the object.
- X
- If the action type is ASSIGN the value of the other
- object is set to the string. Additionally the screen representation of the
- object is updated to reflect the new value (if it makes sense to do so).
- For example if the value of a dialog is updated the text field of the
- dialog will contain the updated string. If a slider is updated the
- slider thumb will be moved to the corresponding position.
- X
- The format specified can contain the names of objects preceded
- by a dollar "$" sign. The value of the string associated with the object
- is substitued in the generated string. The special symbol "$val" is used
- to refer to the string associated with the current object. An object name can
- be enclosed in brackets to avoid syntactic ambiguity. You can use "$(val)" or
- "$val", the first form is recommended. If you do not enclose the name in
- brackets it will be assumed to end at the next space, dollar sign or quote.
- You should give an object a name if you intend to use its string in the
- action of another object.
- A double
- dollar sign "$$" is used to generate a single dollar in the generated
- string.
- X
- If a format contains a command enclosed in backquotes then the output
- produced by running the command will be subsituted in the generated string.
- The command will be run when the action takes place. i.e. if a backquoted
- command is present in the action for a button then the command will be run
- each time the button is pressed. Note that the evaluation of the command
- takes place after the substitution of object values, thus the backquoted
- command evaluated at action time may contain an evaluated object value.
- X
- The ASSIGN action is special because the word immediately following
- the word ASSIGN (separated by blanks) is the name of an object that
- will have its value modified.
- The format is thus assumed to start at the second word after ASSIGN.
- X
- The SET action is another special case. The set action allows you
- to modify not the value of an object, but one of its resources,
- such as foreground or background color, font, orientation, etc.
- The word immediately following the word SET is the name of the
- object; the next word is the resource you wish to set. Following
- that is the resource specification.
- See the section above on MISCELLANEOUS PARAMETERS to see which attributes
- can be changed with the SET action.
- X
- An action type of PRINT is used for any action command that begins with
- PRINT (It must be in upper case and start at the first character of the action
- string). An action type of STRING is used for any command that begins with
- STRING. An action type of ASSIGN is used for any command that begins with
- the word ASSIGN. An action type of SET is used for any command that
- begins with SET.
- An action type of SYSTEM is used for any command that doesn't
- begin with QUIT, STRING, PRINT, SET or ASSIGN or if it begins with SYSTEM.
- X
- X
- Following are two examples of using actions.
- X
- Here is a choice object that uses its value as a parameter
- for an imaginary system command, showcolor:
- X
- .nf
- choice={ label=colors value="255 0 0" action="showcolor -rgb $(val)"
- X item={ label=red value="255 0 0" }
- X item={ label=green value="0 255 0" }
- X item={ label=blue value="0 0 255" }
- X }
- .fi
- X
- In this next example, the list item has no action specified. Actions
- default to type NONE; the list will maintain a string containing
- the value of the selected list item, but will do nothing more.
- Here a separate button is used to do something with the list's
- output:
- X
- .nf
- message={ label="press button to find out which item is selected" }
- list={ label=numbers name=listout
- X itemlist={ list="1 2 3"
- X }
- button={ label="press for answer"
- X action="PRINT list selection is $(listout)" }
- .fi
- X
- In this example the assign action is used to reset the value of a dialog
- to a known string (fred). The reset button assigns the string to the dialog.
- The dialog itself has two actions, the first prints the value of the
- text field and the second action quits xtpanel.
- X
- .nf
- dialog={ label=dialog value="fred"
- X action="PRINT I am $(val)"
- X action=QUIT
- X }
- X
- button={ label=RESET action="ASSIGN dialog fred" }
- .fi
- X
- X
- In the final example the user can select a file from all the ".ps" files
- in the current directory. The file is then viewed with the ghostview program:
- X
- .nf
- button={ label=QUIT action=QUIT }
- list={ label="Choose a file" action="ghostview $(val)"
- X itemlist={ list=`echo *.ps` }
- X }
- .fi
- X
- .SH BOXES
- Several objects are provided to manage the appearance
- of the panel. These box objects group other objects
- into boxes that are oriented either vertically or
- horizontally. In a vertically oriented box,
- the objects are arranged in a single column, and then
- a box is drawn around them. A vertically oriented box
- (vbox) is specified as follows:
- X
- .nf
- vbox={ name=
- object_type={ parameter=value ... }
- object_type={ parameter=value ... }
- }
- .fi
- X
- All of the objects bounded by the starting and ending braces
- of a box will be grouped together in the box. In addition
- to vbox, there is hbox, which is oriented horizontally,
- and vpane and hpane, where the objects within the box are
- separated by movable partitions (these use the Athena
- paned widget). There is also box and pane; these default
- to vbox and vpane, but could be overridden from a resource
- file.
- X
- Boxes can be nested. In this way, fairly precise control
- over a panel's layout is obtained.
- X
- Box objects have only a single parameter, \fIname\fB.
- Two special names are recognized by the resource
- file; boxes with name=\fInoborder\fB will have no
- border drawn around them. If you use boxes extensively
- to arrange objects on the panel, using noborder can help
- avoid the tunnel-like appearance of multiple nested boxes.
- Also, one of the examples makes use of a special
- box name \fIsqueezebox\fB.
- This name triggers definitions in
- the resource file that "squeeze out" the annotation
- of sliders, choices, and buttons that are grouped together
- in such a box. When a number of sliders are squeezed together
- in this way, the result is a seemingly new object that lets
- the user manipulate the data samples of a function. See the
- "sliderbox" examples in the panel brought up doing "run_demos"
- in the xtpanel source directory.
- X
- .SH COMMAND LINE INTERFACE
- On the command line, objects are specified in the following
- format:
- X
- xtpanel -object_type value value ... -object_type value...
- X
- The values must be specified in a prescribed order, as described
- below for each object type. You can specify as many of the
- values for a given object as you wish; the "-" on the object
- type is the signal to xtpanel to stop reading parameters for
- one object and begin the next. But in
- order to specify a value for one parameter, you MUST specify values all those
- that precede it, in exactly the order specified here.
- X
- The values for each object are described in the section
- above named DESCRIPTION OF OBJECTS AND SCRIPT SYNTAX.
- Here we simply list them in the order that they
- must be specified from the command line.
- X
- .nf
- \-message [value]
- \-text [action name value width height editType]
- \-dialog [label action name value]
- \-button [label action name value]
- \-toggle [label action name value]
- \-slider [label action name value min max format width height]
- \-scrollbar [action name value min max format width height]
- \-choice [label action name value numchoice label value ...]
- \-menubutton [label action name value numchoice label value ...]
- \-list [label action name value numchoice label value ...]
- \-graph [nsamp label action name value min max format width height]
- \-var [name value]
- \-quit
- .fi
- X
- For the multiple-choice objects (choice, menubutton, and list),
- you must specify a label (which gets displayed on the screen)
- and a value (used on output) for each item, and you must
- precede these by the number of items in the choice,
- menubutton, or list (which is not required in a script).
- There is no analog
- to the script "itemlist" object, which lets you specify only
- one string for each item instead of two.
- X
- Note that the box objects described above (see BOXES),
- used to group objects into horizontally or vertically
- oriented boxes, are not available from the command line.
- X
- .SH COMMAND LINE EXAMPLES
- The following examples illustrate the use of xtpanel from the
- command line:
- X
- This example contains a quit button and a message:
- X
- .nf
- xtpanel -quit -message "this is a message"
- .fi
- X
- This example contains a choice:
- X
- .nf
- xtpanel -choice "this is a choice" 'PRINT choice is $val' name 1 \
- 3 one 1 two 2 three 3
- .fi
- X
- This example contains a slider and a button that outputs the slider's value:
- X
- .nf
- xtpanel -quit -slider "this is a slider" 'PRINT slider value is $val'
- name 5 0 10 "%.0f" 100 20 -button "press me" 'PRINT slider value is $name'
- .fi
- X
- .SH GENERAL COMMAND LINE OPTIONS
- .TP
- .B \-file filename
- Read in the script file "filename". Xtpanel also looks for
- a script file on stdin. The filename specified in this way is searched
- for in a number of possible directories.
- If the environment variable "XTPANEL_PATH" is set it is assumed to be
- a colon separated list of directories to be searched. If the file is not found
- in these directories the program will search a directory called .xtpanel in
- the users home directory and then the system xtpanel directory.
- X
- If the environment variable is not
- set the program will search the current directory, followed by ~/.xtpanel
- followed by the system xtpanel directory.
- X
- The system directory is specified in the Makefile used to compile the
- xtpanel program. At compilation time on this system it was set to
- SYS_XTPANELDIR.
- X
- .TP
- .B \-cpp [cpp_args]
- If the -cpp flag is specified then all files read using the "-file" flag
- will be passed though the C-preprocessor before being parsed. The preprocessor
- will be invoked using any command line arguments that look like they might be
- C-preprocessor arguments. Currently this is interpreted as being any argument
- that starts with "-I" or "-D". Note the standard input is never passed through
- cpp. If you wish to to this you should pipe the output of cpp into xtpanel
- yourself.
- X
- This option can be very useful in designing system wide xtpanel scripts
- where a few key words may be changed at each invocation. These words may
- be redefined with "-Doldname=newname". The -cpp option can also be used to
- define macros for repeated parts of script files or even including prebuilt
- pieces of script files from elsewhere. The following example illustrates
- some of these possibilities.
- X
- .nf
- #ifndef NAME
- #define NAME "default name"
- #endif
- X
- #define mkslid(VAL) slider={ label="" min=0 max=100 value=VAL width=300 \
- height=25 format="%.0f" action="STRING $val" }
- X
- label={ value=NAME }
- X
- mkslid(0)
- mkslid(10)
- mkslid(20)
- .fi
- X
- .TP
- .B \-help
- Invokes a series of xtpanel scripts that present information
- about xtpanel, mostly taken from this manual page, in an
- interactive, menu-driven form.
- X
- .TP
- .B \-tty
- Read a script from the terminal. Generally not recommended;
- it is better to save the script in a file first. If this option
- is not set the program will not accept input from standard input if
- it is a terminal. You can redirect standard input and pipe data to
- xtpanel without setting this option.
- X
- .SH RESOURCES
- All widgets are constructed using the "name" parameter of the object.
- The X-toolkit resource mechanism can be used to control the appearance
- of an object based on either its class or its name.
- The xtpanel objects are constructed from Xaw widgets as follows:
- X
- .IP message 10
- is a Label widget
- .IP button 10
- is a Command widget
- .IP toggle 10
- is a Toggle widget
- .IP dialog 10
- is a Dialog widget
- .IP text 10
- is a Text widget
- .IP scrollbar 10
- is a Scrollbar widget.
- .IP slider 10
- is a Box containing two Labels and a Scrollbar.
- .IP choice 10
- is a Box containing a Label and a number of Toggles.
- .IP menubutton 10
- is a MenuButton. Attached to it is a SimpleMenu, with a
- number of SmeBSB menu entries.
- .IP list 10
- is a Box containing a Label and a List.
- .IP graph 10
- is a Box containing a number of Scollbars, and several Label widgets.
- X
- If I have the following xtpanel script file:
- X
- button={ label=QUIT action=QUIT }
- X
- box={ name=bigfont
- X button={ label=fred action="PRINT fred" }
- X button={ label=joe name=curs action="PRINT joe" }
- }
- X
- and the following resources:
- X
- XXTpanel*Command.Font: fixed
- XXTpanel*bigfont*Command.Font: 8x16
- XXTpanel*bigfont*curs.Font: cursor
- X
- Then the quit button will use the "fixed" font, fred will use "8x16" and
- joe will use "cursor" (and thus be unreadable).
- X
- .SH COPYRIGHT
- Although xtpanel is not in the public domain, its copyright is not
- very restrictive. Here is the official xtpanel copyright notice (the one
- that all the source files tell you about):
- .PP
- Copyright 1992 the Board of Trustees of the Leland Stanford Junior
- University. All Rights Reserved. Permission is hereby given
- to use, copy, modify, and distribute this software provided
- that (1) copyright and proprietary notices are retained in
- each copy, (2) any files which are modified are identified as such,
- and (3) you do not copy or distribute the software for payment or
- for commercial use without prior written consent from Stanford.
- STANFORD MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND
- concerning this software or its use.
- X
- .SH BUGS
- Probably many. Please send bug reports, suggestions,
- interesting xtpanel scripts, code to support new widgets, etc.
- to the authors.
- X
- X
- .SH AUTHORS
- Steve Cole (steve@sep.stanford.edu)
- .br
- Dave Nichols (dave@sep.stanford.edu)
- .br
- Stanford Exploration Project, Department of Geophysics
- .br
- Stanford University, Stanford, CA, 94305-2215
- SHAR_EOF
- chmod 0664 xtpanel/xtpanel.man.sed ||
- echo 'restore of xtpanel/xtpanel.man.sed failed'
- Wc_c="`wc -c < 'xtpanel/xtpanel.man.sed'`"
- test 38445 -eq "$Wc_c" ||
- echo 'xtpanel/xtpanel.man.sed: original size 38445, current size' "$Wc_c"
- fi
- # ============= xtpanel/xtpanel-generator.script ==============
- if test -f 'xtpanel/xtpanel-generator.script' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/xtpanel-generator.script (File already exists)'
- else
- echo 'x - extracting xtpanel/xtpanel-generator.script (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/xtpanel-generator.script' &&
- #!/bin/csh -f
- X
- xtpanel -name "xtpanel generator" -file generator/generator
- SHAR_EOF
- chmod 0664 xtpanel/xtpanel-generator.script ||
- echo 'restore of xtpanel/xtpanel-generator.script failed'
- Wc_c="`wc -c < 'xtpanel/xtpanel-generator.script'`"
- test 75 -eq "$Wc_c" ||
- echo 'xtpanel/xtpanel-generator.script: original size 75, current size' "$Wc_c"
- fi
- # ============= xtpanel/NoImake ==============
- if test -f 'xtpanel/NoImake' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/NoImake (File already exists)'
- else
- echo 'x - extracting xtpanel/NoImake (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/NoImake' &&
- #!/bin/csh
- #The following files are used by NoImake:
- # NoImake.cpp contains variable definitions and machine specific flags
- # NoImake.m4 contains Imake-rules in form of m4 macro definitions
- #
- # Martin Karrenbach 8-25-92
- X
- echo "You are running an Imake substitute to create: Makefile"
- if ( "$1" == "" ) then
- echo "You can give the optional argument: SUN4, RS6000, HP700 or DEC3100"
- endif
- echo "You may have to edit the file:"
- echo " NoImake.cpp"
- echo "to set machine specific flags and rerun NoImake."
- X
- X
- if ( "$1" == "" ) then
- cat NoImake.cpp Imakefile | /lib/cpp > Makefile.tmp
- else
- cat NoImake.cpp Imakefile | /lib/cpp -D$1 > Makefile.tmp
- endif
- m4 NoImake.m4 Makefile.tmp > Makefile
- rm -f Makefile.tmp
- X
- foreach dir ( generator help )
- X echo making Makefile in $dir
- X cd $dir;
- X if ( "$1" == "" ) then
- X cat ../NoImake.cpp Imakefile | /lib/cpp > Makefile.tmp
- X else
- X cat ../NoImake.cpp Imakefile | /lib/cpp -D$1 > Makefile.tmp
- X endif
- X m4 ../NoImake.m4 Makefile.tmp > Makefile
- X rm -f Makefile.tmp
- X cd ..
- end
- X
- foreach dir ( examples )
- X echo making Makefile in $dir
- X cd $dir;
- X if ( "$1" == "" ) then
- X cat ../NoImake.cpp Imakefile | /lib/cpp > Makefile.tmp
- X else
- X cat ../NoImake.cpp Imakefile | /lib/cpp -D$1 > Makefile.tmp
- X endif
- X m4 ../NoImake.m4 Makefile.tmp > Makefile
- X rm -f Makefile.tmp
- X
- X foreach subdir ( commandline script )
- X echo making Makefile in $dir/$subdir
- X cd $subdir;
- X if ( "$1" == "" ) then
- X cat ../../NoImake.cpp Imakefile | /lib/cpp > Makefile.tmp
- X else
- X cat ../../NoImake.cpp Imakefile | /lib/cpp -D$1 > Makefile.tmp
- X endif
- X m4 ../../NoImake.m4 Makefile.tmp > Makefile
- X rm -f Makefile.tmp
- X cd ..
- X end
- X cd ..
- end
- X
- SHAR_EOF
- chmod 0775 xtpanel/NoImake ||
- echo 'restore of xtpanel/NoImake failed'
- Wc_c="`wc -c < 'xtpanel/NoImake'`"
- test 1708 -eq "$Wc_c" ||
- echo 'xtpanel/NoImake: original size 1708, current size' "$Wc_c"
- fi
- # ============= xtpanel/eval_command.h ==============
- if test -f 'xtpanel/eval_command.h' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/eval_command.h (File already exists)'
- else
- echo 'x - extracting xtpanel/eval_command.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/eval_command.h' &&
- X
- #ifndef EVAL_COMM_H
- #define EVAL_COMM_H
- X
- #ifndef _NO_PROTO
- extern char* eval_command( char*);
- #else
- extern char* eval_command();
- #endif
- X
- #endif
- SHAR_EOF
- chmod 0664 xtpanel/eval_command.h ||
- echo 'restore of xtpanel/eval_command.h failed'
- Wc_c="`wc -c < 'xtpanel/eval_command.h'`"
- test 145 -eq "$Wc_c" ||
- echo 'xtpanel/eval_command.h: original size 145, current size' "$Wc_c"
- fi
- # ============= xtpanel/eval_command.c ==============
- if test -f 'xtpanel/eval_command.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/eval_command.c (File already exists)'
- else
- echo 'x - extracting xtpanel/eval_command.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/eval_command.c' &&
- /*
- X * Copyright 1992 the Board of Trustees of the Leland Stanford Junior
- X * University. Official permission to use this software is included in
- X * the documentation. It authorizes you to use this file for any
- X * non-commercial purpose, provided that this copyright notice is not
- X * removed and that any modifications made to this file are commented
- X * and dated in the style of the example below.
- X */
- X
- /*
- X *
- X * source file: ./xtpanel/eval_command.c
- X *
- X * Steve Cole, Dave Nichols (SEP), September 9 1992
- X * Inserted this sample edit history entry.
- X * Please log any further modifications made to this file:
- X * Steve Cole, Dave Nichols (SEP), November 20 1992 - version 2.00
- X * 1) added new objects: toggle, scrollbar, graph.
- X * 2) added new actions: ASSIGN, SET.
- X * 3) objects can have multiple actions.
- X * 4) backquoted strings in actions get executed at action time.
- X */
- X
- /* This routine should evaluate a command using an appropriate shell
- X * and return the data from stdout in the a character buffer.
- X *
- X * This implementation uses popen() to do this. There may be faster ways on
- X * some systems but this is reasonably portable.
- X */
- X
- #include <stdio.h>
- #include <string.h>
- X
- #if defined _POSIX_SOURCE
- #include <unistd.h>
- #endif
- X
- #if defined __STDC__ || defined __stdc__
- #include <stdlib.h>
- #else
- #if defined AIXV3 || defined sun || defined ultrix
- #include <stdlib.h>
- #else
- extern char* malloc();
- #endif
- #endif
- X
- #include "eval_command.h"
- #include "string_buf.h"
- X
- /* evaluate a back-quoted command */
- #define CBUF_LEN 20000
- static char comm_buf[CBUF_LEN];
- X
- char* eval_command( comm )
- char* comm;
- {
- FILE* in;
- int num,pos;
- char *ret;
- string_buf *buffer;
- X
- if( (in = popen( comm, "r" )) == (FILE*)0 ) {
- X perror("eval_command");
- X exit(-1);
- }
- X
- buffer = buf_start();
- X
- while( (num = fread( comm_buf, 1, CBUF_LEN, in )) != 0 ){
- X buf_cat( buffer, comm_buf, num );
- };
- pclose( in );
- X
- /* trim off trailing whitespace */
- buf_trim( buffer, " \t\n" );
- X
- ret = buf_fetch( buffer );
- X
- buf_free( buffer );
- X
- return ret;
- }
- SHAR_EOF
- chmod 0664 xtpanel/eval_command.c ||
- echo 'restore of xtpanel/eval_command.c failed'
- Wc_c="`wc -c < 'xtpanel/eval_command.c'`"
- test 2031 -eq "$Wc_c" ||
- echo 'xtpanel/eval_command.c: original size 2031, current size' "$Wc_c"
- fi
- # ============= xtpanel/help/general ==============
- if test ! -d 'xtpanel/help'; then
- echo 'x - creating directory xtpanel/help'
- mkdir 'xtpanel/help'
- fi
- if test -f 'xtpanel/help/general' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/help/general (File already exists)'
- else
- echo 'x - extracting xtpanel/help/general (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/help/general' &&
- X
- DESCRIPTION
- X xtpanel provides a quick and easy way of producing a panel
- X containing interactive objects such as buttons, sliders, and
- X text fields, either from the command line or from an xtpanel
- X script file. Each panel object maintains a string represen-
- X tation of its value. When the object is modified it updates
- X its value and it can also perform one or more actions such
- X as printing its value or calling a system command. Objects
- X can make use of the values of other objects in constructing
- X their actions and they can set the values of other objects
- X as the result of an action. The result is an interactive X
- X windows program, without the need for conventional program-
- X ming.
- X
- X
- X Three utilities are provided with xtpanel. The first is a
- X script generator. This is a collection af xtpanel scripts
- X that can be used to generate, examine and test xtpanel
- X script files. It is invoked using the command xtpanel-
- X generator. The second utility is a collection of example
- X scripts and a master script that can be use to view and run
- X the examples. It is invoked using the command xtpanel-
- X examples. A particularly powerful demo is the "lister"
- X script example, which is a tool for maneuvering through a
- X Unix filesystem and viewing files at any level. The third is
- X a set of xtpanel scripts that present information about
- X xtpanel, mostly taken from this manual page, in an interac-
- X tive, menu-driven form. This is invoked by doing xtpanel
- X -help.
- X
- X
- OBJECT TYPES
- X xtpanel supports the following objects:
- X
- X
- X message Displays a single line of text.
- X
- X
- X text Displays multiple lines of text in a scrollable
- X area. Can be read-write or read-only.
- X
- X
- X dialog Provides an editable text field, with a label and
- X an OK button.
- X
- X
- X button A single button.
- X
- X
- X toggle A button that can be toggled between two states.
- X
- X
- X slider Allows the user to choose a value from a range of
- X integer or floating point values.
- X
- X
- X scrollbar Similar to a slider, but simpler in appearance.
- X
- X
- X choice A group of buttons, only one of which may be
- X selected at a time.
- X
- X
- X menubutton
- X A button with a menu attached.
- X
- X
- X list A list of character strings, only one of which may
- X be selected at a time.
- X
- X
- X graph An object containing a number of scrollbars, each
- X of which controls the value for one sample of a
- X list of numbers.
- X
- X
- X var A variable that has no screen representation but
- X stores a value.
- X
- X
- X In addition there are several objects that group other
- X objects together in boxes. Grouping objects in this way
- X allows greater control of the panel layout. See the section
- X below on BOXES.
- X
- DESCRIPTION OF OBJECTS AND SCRIPT SYNTAX
- X Here is a more detailed description of the objects, the
- X parameters relevant to each, and the syntax for building
- X these objects in a script file.
- X
- X The general format for specifying an object in a script file
- X is:
- X
- X objecttype={ parameter=value ... }
- X
- X Note that no spaces are allowed between the objecttype and
- X the "{".
- X
- X Each "value" can take one of four forms: A single word, a
- X string enclosed in single quotes, string enclosed in double
- X quotes, a system command enclosed in backquotes. See the
- X section "SCRIPT SYNTAX DETAILS" for more information on the
- X syntax.
- X
- X
- X There are four parameters that many objects have in common,
- X these are: name, label, action and value.
- X
- X name is the name of the object. The name serves two pur-
- X poses, it can be referred to by other objects who wish to
- X obtain the or modify the string representation of the
- X object.
- X
- X The name can also be used in modifying the appearance of an
- X object using the X-toolkit resource mechanism.
- X
- X When names are referred to by other objects they start with
- X a dollar sign and optionally an opening brace. They are
- X assumed to end at the next space or closing brace. Therefore
- X a name may not contain spaces, braces or dollar signs.
- X
- X label is the label that appears on the object. By default it
- X is the set to the name. It will appear in an "appropriate"
- X place which depends on the object type. Some objects do not
- X have labels, the label parameter is ignored for these
- X objects.
- X
- X value is the initial string value associate with the object.
- X If the object is modified this string value will change. It
- X defaults to be the same as label.
- X
- X action is an action that occurs when the button is pressed.
- X Defaults to "NONE", which means that the button simply main-
- X tains a string, containing its value, for use by other
- X objects. Other actions are PRINT (print string to standard
- X output), SYSTEM (execute a command), STRING (reformat the
- X internal representation of the object's value, where the
- X string can contain more than just the object's value) ,
- X ASSIGN (set another object's value to a given string), SET
- X (set an attribute of an object; e.g. color ) and QUIT (quit
- X xtpanel). See the section below on ACTIONS for more details.
- X If more than one action is present the actions will be per-
- X formed in the order that they are specified.
- SHAR_EOF
- chmod 0664 xtpanel/help/general ||
- echo 'restore of xtpanel/help/general failed'
- Wc_c="`wc -c < 'xtpanel/help/general'`"
- test 5609 -eq "$Wc_c" ||
- echo 'xtpanel/help/general: original size 5609, current size' "$Wc_c"
- fi
- # ============= xtpanel/help/message ==============
- if test -f 'xtpanel/help/message' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/help/message (File already exists)'
- else
- echo 'x - extracting xtpanel/help/message (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/help/message' &&
- X
- X message
- X A message displays a single line of text on a panel.
- X Messages are used to give short instructions or bits of
- X information to the user. The script syntax for a message
- X is:
- X
- X message={ value=.... name=.... }
- X
- X The most important variable in a message object is the
- X value. The value is the text that is displayed on the
- X screen. The name is relevant for tailoring the appearance
- X of this message object using resources or assigning new
- X values to the message. If a new value is assigned to the
- X message the text will change to reflect the new value.
- X
- X example:
- X message={ value=" hello world, I am a message object " }
- X
- X Assigning a new value to a message object (using an
- X ASSIGN action) will change the text that is displayed.
- SHAR_EOF
- chmod 0664 xtpanel/help/message ||
- echo 'restore of xtpanel/help/message failed'
- Wc_c="`wc -c < 'xtpanel/help/message'`"
- test 874 -eq "$Wc_c" ||
- echo 'xtpanel/help/message: original size 874, current size' "$Wc_c"
- fi
- # ============= xtpanel/help/objects ==============
- if test -f 'xtpanel/help/objects' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/help/objects (File already exists)'
- else
- echo 'x - extracting xtpanel/help/objects (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/help/objects' &&
- X
- OBJECT TYPES
- X xtpanel supports the following objects:
- X
- X
- X message Displays a single line of text.
- X
- X
- X text Displays multiple lines of text in a scrollable
- X area. Can be read-write or read-only.
- X
- X
- X dialog Provides an editable text field, with a label and
- X an OK button.
- X
- X
- X button A single button.
- X
- X
- X toggle A button that can be toggled between two states.
- X
- X
- X slider Allows the user to choose a value from a range of
- X integer or floating point values.
- X
- X
- X scrollbar Similar to a slider, but simpler in appearance.
- X
- X
- X choice A group of buttons, only one of which may be
- X selected at a time.
- X
- X
- X menubutton
- X A button with a menu attached.
- X
- X
- X list A list of character strings, only one of which may
- X be selected at a time.
- X
- X
- X graph An object containing a number of scrollbars, each
- X of which controls the value for one sample of a
- X list of numbers.
- X
- X
- X var A variable that has no screen representation but
- X stores a value.
- X
- X
- X In addition there are several objects that group other
- X objects together in boxes. Grouping objects in this way
- X allows greater control of the panel layout. See the section
- X below on BOXES.
- SHAR_EOF
- chmod 0664 xtpanel/help/objects ||
- echo 'restore of xtpanel/help/objects failed'
- Wc_c="`wc -c < 'xtpanel/help/objects'`"
- test 1367 -eq "$Wc_c" ||
- echo 'xtpanel/help/objects: original size 1367, current size' "$Wc_c"
- fi
- # ============= xtpanel/help/text ==============
- if test -f 'xtpanel/help/text' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/help/text (File already exists)'
- else
- echo 'x - extracting xtpanel/help/text (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/help/text' &&
- X
- X text
- X A text object displays any number of lines of text in a
- X multi-line scrollable region.
- X
- X text={ action=... name=.... value=... editType=... }
- X
- X The value is the text to be displayed on the screen.
- X Newlines in the value will cause the text to start a new
- X line. The name is relevant for tailoring the appearance
- X of this text object using resources or assigning new
- X values to the message. If a new value is assigned to the
- X text the text will change to reflect the new value.
- X editType is used to select whether editing of the text is
- X allowed. Choices are read (read-only), append (can add to
- X text but not modify existing text), edit (read-write).
- X
- X Assigning a new value to a text object will change the
- X text that is displayed.
- X
- X examples:
- X text={ value="I am a multiline \n text object \n with
- X three lines" }
- X text={ value=`cat README` }
- SHAR_EOF
- chmod 0664 xtpanel/help/text ||
- echo 'restore of xtpanel/help/text failed'
- Wc_c="`wc -c < 'xtpanel/help/text'`"
- test 1012 -eq "$Wc_c" ||
- echo 'xtpanel/help/text: original size 1012, current size' "$Wc_c"
- fi
- # ============= xtpanel/help/dialog ==============
- if test -f 'xtpanel/help/dialog' -a X"$1" != X"-c"; then
- echo 'x - skipping xtpanel/help/dialog (File already exists)'
- else
- echo 'x - extracting xtpanel/help/dialog (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xtpanel/help/dialog' &&
- X
- X dialog
- X A dialog displays an editable line of text. Syntax:
- X
- X dialog={ label=... value=... name=... action=... }
- X
- X name defaults to "dialog1", "dialog2" etc. label
- X appears above the text field. value is the text that
- X initially appears in the text field. A value of "" means
- X that the text field will initially be blank. action: An
- X "ok" button is added to the panel, and the dialog object
- X is activated when this button is pressed.
- X
- X Assigning a new value to a dialog changes the displayed
- X string to the new value.
- X
- X example:
- X dialog={ label="Filename to edit" value="" action="xterm
- X -e vi $val" }
- SHAR_EOF
- chmod 0664 xtpanel/help/dialog ||
- echo 'restore of xtpanel/help/dialog failed'
- Wc_c="`wc -c < 'xtpanel/help/dialog'`"
- test 720 -eq "$Wc_c" ||
- echo 'xtpanel/help/dialog: original size 720, current size' "$Wc_c"
- fi
- true || echo 'restore of xtpanel/help/button failed'
- echo End of part 7, continue with part 8
- exit 0
- -----------------------------------------------------------------
- Steve Cole (steve@sep.stanford.edu, apple!sep!steve)
- Department of Geophysics, Stanford University, Stanford, CA 94305
-