Here is a simple example. The panel shown in Figure is
generated from the following script:
button={ label=QUIT action=QUIT }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.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 } }
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.
filt
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. | ![]() |