
DESCRIPTION
     xtpanel lets you build panels containing interactive objects
     such  as  buttons, sliders, and text fields, either from the
     command line or from an xtpanel  script  file.   Here  is  a
     one-line  xtpanel  script  that  builds  the standard "Hello
     world" example:


     button={ label="Hello world" action="PRINT $val" }

     When this script is read by xtpanel, a  panel  is  produced,
     containing  a  single  object,  a  button with "Hello world"
     written on it. When the  button  is  pressed,  the  button's
     value  (which  by  default  is  the  same  as  its label) is
     printed.  In addition to printing, objects  can  run  system
     commands  or  modify  other  panel objects. Here is a simple
     digital clock, using a  timer  object  that  runs  the  UNIX
     "date"  command once each second, then uses an ASSIGN action
     to display the result in a text field:


     field={  name=disp  background=black   foreground=yellow   }
     timer={ interval=1 action="ASSIGN disp `date`" }

     Object attributes such  as  the  foreground  and  background
     colors used in this example allow you to customize a panel's
     appearance.

     xtpanel actions can perform a variety of tasks, in  addition
     to  the  examples  of  printing  to  screen  and changing an
     object's value shown above. Actions can  modify  the  attri-
     butes of an object (such as color, size, visibility, or sen-
     sitivity), or dynamically create or destroy objects. Actions
     can also be performed only when a certain condition is true.

     The result is an  interactive  X  Window  program,  using  a
     scripting  language  that  we  believe  to be much easier to
     learn and use than conventional X programming.

     Several utilities are provided to help  you  get  acquainted
     with  xtpanel.  The  first  is an interactive tutorial. This
     gives an overview of xtpanel, with some simple examples. The
     user  can see the examples and the scripts that create them,
     and in many cases modify the scripts and see  what  happens.
     The  tutorial  is  run  by  typing xtpanel-tutor. 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 xtpanel-examples.  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 typing xtpanel -help (note the space).


     The xtpanel generator lets you build xtpanels without having
     to  learn  or  directly  use  the  script language. It is an
     interactive utility that takes you through  the  process  of
     panel  construction,  letting  you  view  the  panel (or the
     underlying script) at any point. The generator,  which  like
     the rest of these utilities is written using xtpanel, can be
     invoked by typing xtpanel-generator.


OBJECT TYPES
     xtpanel supports the following objects:


     message   Displays a single line of text. Read only.


     text      Displays multiple lines of text  in  a  scrollable
               area.  Can  be  read/write or read only, or append
               only.


     field     Same as text, but for only a single line of  text.
               Always read/write.


     dialog    Like field, with a label and  an  OK  button  that
               performs some action.


     button    A simple button.


     toggle    A button that can be toggled between two states.


     slider    Allows the user to choose a value from a range  of
               integer  or  floating  point  numbers. Has a label
               that displays the current value, and an OK  button
               to perform the slider's actions.


     scrollbar Like a slider, but without the label or OK button.


     choice    A group of buttons,  only  one  of  which  may  be
               selected at a time.


     menubutton
               A button with a menu attached.


     list      A list of character strings, only one of which may
               be selected at a time.


     var       A variable that has no screen  representation  but
               stores  a  value.  A variable's actions, if it has
               any, are executed whenever the value stored in the
               variable is modified.


     startup   An object that has no  screen  representation  but
               executes its action[s] when the object is created,
               at startup time. Useful for initializing a panel.


     timer     An object that has no  screen  representation  but
               executes  its  action[s] at set intervals, without
               user interaction.


     input     An object that has no  screen  representation  but
               executes its action[s] when input is available.


     output    An object that has no  screen  representation  but
               passes information to a UNIX process.


     pipe      A combination of input and output; a pipe starts a
               UNIX  process,  can  send commands to the process,
               and executes its action[s]  when  input  from  the
               process is available.


     graph     An object containing a number of scrollbars,  each
               of  which  controls  the value for one sample of a
               list of numbers.


     grid      An object containing a two-dimensional  matrix  of
               buttons.  Pressing one of the buttons executes the
               grid's action[s], optionally  making  use  of  the
               coordinates of the selected button.


     togglegrid
               Like grid, except the buttons are replaced by tog-
               gles.   A  bitmap of the states of all the toggles
               can be generated.


     In addition the following  composite  objects  are  used  to
     group a number of objects together:


     window    A window object pops  up  its  own  sub-panel,  on
               which any number of objects can be displayed.


     box       A box handles the layout  of  a  number  of  child
               objects.  Objects are laid out vertically (or hor-
               izontally using the hbox object), and a new row or
               column is begun when needed.


     form      A form gives the user  greater  control  over  the
               positioning  of  objects  within  it.  The x and y
               coordinates of each form object must be specified,
               relative  to  the upper left corner of the form or
               relative to another form object.


     pane      A pane object arranges its children either  verti-
               cally  or  horizontally (hpane) in panes of a win-
               dow, with  movable  grips  between  each  pair  of
               panes.


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.

     The general format for specifying an object in a script file
     is:

     objecttype={ parameter=value ... }

     Note that no spaces are allowed between the objecttype  and
     the "{".

     Each "value" can take one of four forms: A  single  word,  a
     string  enclosed in single quotes, a string enclosed in dou-
     ble quotes or a string enclosed in backquotes. See the  sec-
     tion  "SCRIPT  SYNTAX  DETAILS"  for more information on the
     syntax.


     There are five parameters that many objects have in  common,
     these are: name, label, action, test and value.

     name is the name of the object. The  name  serves  two  pur-
     poses,  it  can  be referred to by other objects who wish to
     obtain the  or  modify  the  string  representation  of  the
     object.

     The name can also be used in modifying the appearance of  an
     object using the X-toolkit resource mechanism.

     When names are referred to by other objects they start  with
     a  dollar  sign  and optionally an opening parenthesis. They
     are assumed to end at the next space or closing parenthesis.
     Therefore a name may not contain spaces, parentheses or dol-
     lar signs.

     label 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.

     value 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.

     action is an action that occurs when the object is  modified
     -  when a button is pressed, a scrollbar is moved, etc. Some
     objects (slider and dialog) have separate buttons to trigger
     the action.  Defaults to "NONE", which means that the object
     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 (refor-
     mat 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).  Also  there  are  two  actions  that allow you to
     dynamically create and destroy  panel  objects,  CREATE  and
     DESTROY, and an EVAL action that lets you dynamically define
     the action to  be  performed.   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.

     test is a composite object that contains a condition and two
     sets  of  actions.  One set is performed if the condition is
     true the other if it is false.  See  the  section  below  on
     ACTIONS for more details.
