previous up next print clean
Next: Interactivity with xtpanel Up: Introduction Previous: Introduction

Xtpanel overview

Xtpanel allows one to build a user interface, a panel containing interactive objects such as buttons, sliders, text fields, and lists -- either directly from the command line, or using a simple scripting language. Each object can have one or more actions which take place whenever the object is modified. Actions can execute a system command (a background seismic job, for example), or modify other panel objects in some way.

Here is a simple example. The panel shown in Figure [*] is generated from the following script:

button={ label=QUIT action=QUIT }

button={ label=RUN action="Spike n1=128 nsp=1 k1=64 | Bandpass flo=$flo fhi=$fhi phase=$phase | Graph | Tube" }

slider={ name=flo label="Low cut" min=0 max=125 value=10 format="%.2f" width=200 }

slider={ name=fhi label="High cut" min=0 max=125 value=30 format="%.2f" width=200 }

choice={ name=phase label=Phase value=0 orientation=horizontal item={ label=Zero value=0 } item={ label=Minimum value=1 } }

In just a few lines, we have built an interactive frontend to an existing seismic filtering program. The panel contains several different xtpanel objects -- buttons, sliders, and a choice object. Most of the objects in this example have no action; it is the RUN button that puts the values of the objects together (referring to each object by $name) and then calls the bandpass filter program. Actually it calls several programs -- Spike creates a filter with a single impulse; Bandpass does the filtering; Graph makes a graph of the function, and Tube displays the graph on the workstation screen.

While building frontends in this way can be useful, often the overhead of having to re-run the entire job makes this level of interactivity unsatisfying. In the following section, we describe a way to use the interactivity of xtpanel from within programs.

Figure 1
An xtpanel interactive frontend to a bandpass filter program. If you are reading this report on CD-ROM, you can click on the button at the end of this caption to run this example.

previous up next print clean
Next: Interactivity with xtpanel Up: Introduction Previous: Introduction
Stanford Exploration Project