.NH 1 "INTRODUCTION"
.XS
\s12\*(SN  INTRODUCTION\s0
.XE
.sp 2
.PP
\fBPreview\fP is a program to aid the application programmer in prototyping
a desired graphical user interface (GUI).  It simply takes a user interface 
specification (UIS) file, and displays the \fIforms\fP as defined therein.  
A limited amount of error checking on the UIS file 
is done, you will be informed if lines in the UIS file have
incorrect syntax, or are out of place.  For your convenience, editing of 
the UIS file is available from within the \fBpreview\fP program;
during a session of \fBpreview\fP, you may design 
and modify a GUI until its appearance is as desired for your 
particular program.  If you are writing an \fIxvroutine\fP,
you must then go on to use \fBconductor\fP (see the documentation 
on \fBconductor\fP in Chapter 6 of the Khoros Programmer's Manual) to 
automatically generate the code to drive, initialize and extract information 
from the graphical user interface.  If, on the other hand, you are writing 
a \fIvroutine\fP, you will continue directly with the procedure outlined 
in Chapter 1 of the Khoros Programmer's Manual, on Writing Programs.
.sp 3
.NH 1 "USING PREVIEW"
.XS
\s12\*(SN  USING PREVIEW\s0
.XE
.sp 2
\f(CW
% preview [-i UIS_file]
\fP
.sp 2
.PP
The \fBpreview\fP program is very simple.  It may be started
up with a single argument, the [-i] flag, followed by the name of the UIS
file which is to be displayed.  \fBPreview\fP will immediately display the 
\fIforms\fP described by the UIS file, at the same time that its own graphical
user interface is mapped to the screen.  Alternatively, the \fPpreview\fP 
program may be executed with no arguments at all;  you may enter the name
of the desired UIS file from the main form of \fBpreview\fP, and click on the
"SHOW" action button to display the forms described by the UIS file specified.
The "HELP" button on the \fBpreview\fP form will give online help for the use of
\fBpreview\fP;  clicking on the "QUIT" button will exit the \fBpreview\fP
program.
.PP
There are three basic actions that can be taken when running \fBpreview\fP. 
These are to SHOW the UIS file, EDIT the UIS file, or input a new UIS file.  
An input file can be specified at start up, or may be read in after \fBpreview\fP
is running, using the "live" file input selection.  Once a file has been 
selected, and its GUI has been displayed on the screen, editing can begin.
.PP
The UIS file that has been specified is "watched" to see if any changes
are made.  If a change is determined to have occurred, \fBpreview\fP
automatically shows or redisplays the graphical user interface.  With
this in mind, a quick summary of the possible usage scenarios are presented.
.IP 1)
First, an input file is selected and displayed.  Then the EDIT action button is
clicked on; this causes a window to pop up, automatically starting a session with
the editor on the selected UIS file.  NOTE: \fBpreview\fP checks your environment
variables for the string EDITOR to be set.  If it is, then your editor is used;
if not, then "vi" is used.
.IP
While you are editing the file, the displayed GUI will
automatically be redisplayed whenever you write (:w) the file.  This
provides a great deal of flexibility, as other files can be read into
your edit session and temporary files by another name
can be saved at any time.
.IP 2)
In the second scenario, the EDIT command with \fBpreview\fP is not used.  
Instead, you run a session with the desired visual editor separately.  
If you are using \fBpreview\fP to display the same UIS file that is being 
edited, any time you write the file, the modification will automatically 
trigger the SHOW mechanism.  The SHOW action button can be used at any time 
to force the GUI currently specified to be redisplayed.
This is often used when the QUIT button on the displayed form is clicked on
(not the QUIT button on preview).
.sp 3
