Xtpanel


Description

xtpanel is a simple scripting language for creating shell like X-window applications.

xtpanel provides a quick and easy way of producing a panel containing interactive objects such as buttons, sliders, and text fields, either from an xtpanel script file or from the command line. When an object is modified by the user, it can perform actions, such as printing to the screen or calling a system command. Here is a one-line xtpanel script that builds the standard “Hello world” example:

button={ label="Hello world" action="PRINT $(val)\n" }

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 attributes of an object (such as color, size, visibility, or sensitivity), 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. This program is not intended as a replacement for a full featured interface programming toolkit like Tcl/Tk or Dirt or as a replacement for a simple menu builder like xmenu, it falls somewhere in the gap between the two. It is intended as an easy to use tool that can be used to add an interactive wrapper to all those old programs and shells that you have lying around.

Four utilities are provided with xtpanel. All are written as xtpanel scripts.


Installation

The description below assumes that you have a working version of imake (the X11 make program). Should you not have imake, the INSTALL file describes an alternative installation.


Copyright

Here is the official xtpanel copyright notice:

  Copyright 1992, 1993, 1994 The Board of Trustees of the Leland Stanford 
  Junior University. Copyright 1994, 1995, 1996 Dave Nichols and Steve Cole.
  Permission is hereby given to use, copy, modify, and
  distribute this software, subject to the following conditions:
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
  STANFORD  AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES OF 
  ANY KIND CONCERNING THIS SOFTWARE.


Acknowledgements


Bibliography





SEP
Stanford
Exploration Project
GP
Department of
Geophysics
SES
School of
Earth Sciences
Stanford
Stanford
University

Page Maintainer: webmaster@sep.stanford.edu
Copyright © 2009 SEP.