/****************************************************************** xtccreate.c
**  XTC Widget Creation Routine
*/

#define xtc_module 1
#define xtc_charset XmSTRING_ISO8859_1
#include "xtcvers.h"

#include <Xm/Xm.h>			/* Motif Toolkit */
#include <Xm/MainW.h>			/* Motif Main Window */
#include <Xm/BulletinB.h>		/* Motif Bulletin Board */
#include <Xm/DrawingA.h>		/* Motif Drawing Area */
#include <Xm/RowColumn.h>		/* Motif Row Column */
#include <Xm/PushB.h>			/* Motif Push Button */
#include <Xm/CascadeB.h>		/* Motif Cascade Button */
#include <Xm/ToggleB.h>			/* Motif Toggle Button */
#include <Xm/List.h>			/* Motif Scrolled List */
#include <Xm/Label.h>			/* Motif Label */
#include <Xm/Form.h>			/* Motif Form */
#include <Xm/FileSB.h>			/* Motif File Selection Box */
#include <Xm/Scale.h>			/* Motif Scale */
#include <Xm/Text.h>			/* Motif Text */
#include <Xm/Separator.h>		/* Motif Separator */

#include "xtcwc.h"			/* Widgets and callbacks */

void xtccreate()

	{

	char string[80];
	char resource[32];
	int i;
	Arg arg[15];
	int n;
	XmString xmstring;

/*
**  Main window.
*/

	n = 0;
	XtSetArg( arg[n], XmNwidth, 0 ); n++;
	XtSetArg( arg[n], XmNheight, 0 ); n++;
	wmain = XmCreateMainWindow(wshell, "MainWindow", arg, n);

	n = 0;
	XtSetArg( arg[n], XmNorientation, XmHORIZONTAL ); n++;
	wmb = XmCreateMenuBar(wmain, "MenuBar", arg, n);
	XtManageChild(wmb);

	n = 0;
	XtSetArg( arg[n], XmNx, 0 ); n++;
	XtSetArg( arg[n], XmNy, 0 ); n++;
	wform = XmCreateForm(wmain, "Form", arg, n);
	XtManageChild(wform);

	n = 0;
	wpmCommands = XmCreatePulldownMenu(wmb, "PulldownMenu", arg, n);

	xmstring = XmStringCreateLtoR("Commands", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	XtSetArg( arg[n], XmNsubMenuId, wpmCommands ); n++;
	wcbCommands = XmCreateCascadeButton(wmb, "CascadeButton", arg, n);
	XtManageChild(wcbCommands);
	XmStringFree(xmstring);

	n = 0;
	wpmCustomize = XmCreatePulldownMenu(wmb, "PulldownMenu", arg, n);

	xmstring = XmStringCreateLtoR("Customize", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	XtSetArg( arg[n], XmNsubMenuId, wpmCustomize ); n++;
	wcbCustomize = XmCreateCascadeButton(wmb, "CascadeButton", arg, n);
	XtManageChild(wcbCustomize);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Show List Box...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsShowListBox = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsShowListBox);
	XtAddCallback( wpbCommandsShowListBox, XmNactivateCallback, 
			callbackCommandsMenu, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Clear Frame Buffer...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsClearFrameBuffer = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsClearFrameBuffer);
	XtAddCallback( wpbCommandsClearFrameBuffer, XmNactivateCallback, 
			callbackCommandsMenu, 20 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Show Byte Stream...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsShowByteStream = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsShowByteStream);
	XtAddCallback( wpbCommandsShowByteStream, XmNactivateCallback, 
			callbackCommandsMenu, 30 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Erase Screen...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsForceErase = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsForceErase);
	XtAddCallback( wpbCommandsForceErase, XmNactivateCallback, 
			callbackCommandsMenu, 40 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Read Plot File...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsReadPlotFile = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsReadPlotFile);
	XtAddCallback( wpbCommandsReadPlotFile, XmNactivateCallback, 
			callbackCommandsMenu, 50 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Rename Frames...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsRenameFrames = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsRenameFrames);
	XtAddCallback( wpbCommandsRenameFrames, XmNactivateCallback, 
			callbackCommandsMenu, 70 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Fix Aspect Ratio (By Width)", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsFixAspectRatioW = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsFixAspectRatioW);
	XtAddCallback( wpbCommandsFixAspectRatioW, XmNactivateCallback, 
			callbackCommandsMenu, 80 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Fix Aspect Ratio (By Height)", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsFixAspectRatioH = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsFixAspectRatioH);
	XtAddCallback( wpbCommandsFixAspectRatioH, XmNactivateCallback, 
			callbackCommandsMenu, 90 );
	XmStringFree(xmstring);

	n = 0;
	wsepCommandsSeparator = XmCreateSeparator(
			wpmCommands, "Separator", arg, n);
	XtManageChild(wsepCommandsSeparator);

	xmstring = XmStringCreateLtoR("About XTC...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsAboutXTC = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsAboutXTC);
	XtAddCallback( wpbCommandsAboutXTC, XmNactivateCallback, 
			callbackCommandsMenu, 800 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Quit", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCommandsQuit = XmCreatePushButton(
			wpmCommands, "PushButton", arg, n);
	XtManageChild(wpbCommandsQuit);
	XtAddCallback( wpbCommandsQuit, XmNactivateCallback, 
			callbackCommandsMenu, 900 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Frame Buffering...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeFrameBuffering = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeFrameBuffering);
	XtAddCallback( wpbCustomizeFrameBuffering, XmNactivateCallback, 
			callbackCustomizeMenu, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Frame Filing...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeFrameFiling = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeFrameFiling);
	XtAddCallback( wpbCustomizeFrameFiling, XmNactivateCallback, 
			callbackCustomizeMenu, 20 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Frame Printing...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeFramePrinting = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeFramePrinting);
	XtAddCallback( wpbCustomizeFramePrinting, XmNactivateCallback, 
			callbackCustomizeMenu, 30 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Control Sequences...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeControlSeqs = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeControlSeqs);
	XtAddCallback( wpbCustomizeControlSeqs, XmNactivateCallback, 
			callbackCustomizeMenu, 40 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Visibility...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeVisibility = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeVisibility);
	XtAddCallback( wpbCustomizeVisibility, XmNactivateCallback, 
			callbackCustomizeMenu, 50 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Colors...", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeColors = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeColors);
	XtAddCallback( wpbCustomizeColors, XmNactivateCallback, 
			callbackCustomizeMenu, 60 );
	XmStringFree(xmstring);

	n = 0;
	wsepCustomizeSeparator = XmCreateSeparator(
			wpmCustomize, "Separator", arg, n);
	XtManageChild(wsepCustomizeSeparator);

	xmstring = XmStringCreateLtoR("Use Last Saved Settings", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeUseLastSaved = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeUseLastSaved);
	XtAddCallback( wpbCustomizeUseLastSaved, XmNactivateCallback, 
			callbackCustomizeMenu, 100 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Use System Defaults", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeUseDefaults = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeUseDefaults);
	XtAddCallback( wpbCustomizeUseDefaults, XmNactivateCallback, 
			callbackCustomizeMenu, 110 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Save Current Settings", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbCustomizeSaveCurrent = XmCreatePushButton(
			wpmCustomize, "PushButton", arg, n);
	XtManageChild(wpbCustomizeSaveCurrent);
	XtAddCallback( wpbCustomizeSaveCurrent, XmNactivateCallback, 
			callbackCustomizeMenu, 120 );
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 0 ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 0); n++;
	wdraw = XmCreateDrawingArea(wform, "wdraw", arg, n);
	XtManageChild(wdraw);

/*
**  List Box popup.
*/

	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformListBox = XmCreateForm(wshellLB, "Form", arg, n);
	XtManageChild(wformListBox);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightOffset, 10 ); n++;
	wformListBoxTop = XmCreateForm(wformListBox, "Form", arg, n);
	XtManageChild(wformListBoxTop);
                                                                            
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wformListBoxTop ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightOffset, 10 ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomOffset, 10 ); n++;
	wformListBoxBottom = XmCreateForm(wformListBox, "Form", arg, n);
	XtManageChild(wformListBoxBottom);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
	XtSetArg( arg[n], XmNwidth, 180 ); n++;
	XtSetArg( arg[n], XmNvisibleItemCount, 12 ); n++;
	XtSetArg( arg[n], XmNselectionPolicy, XmEXTENDED_SELECT ); n++;
	XtSetArg( arg[n], XmNscrollBarDisplayPolicy, XmSTATIC ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 3 ); n++;
	wslBufferedFrames = XmCreateScrolledList(
			wformListBoxTop, "wsl_Buffered_Frames", arg, n);
	XtManageChild(wslBufferedFrames);
	XtAddCallback( wslBufferedFrames, XmNextendedSelectionCallback, 
			callbackListBoxSelect, 0 );
	XtAddCallback( wslBufferedFrames, XmNdefaultActionCallback, 
			callbackListBoxSelect, 0 );

	xmstring = XmStringCreateLtoR("Draw", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wslBufferedFrames ); n++;
	XtSetArg( arg[n], XmNleftOffset, 7 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNheight, 55 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbDrawBufferedFrame = XmCreatePushButton(
			wformListBoxTop, "PushButton", arg, n);
	XtManageChild(wpbDrawBufferedFrame);
	XtAddCallback( wpbDrawBufferedFrame, XmNactivateCallback, 
			callbackDrawFrame, 0 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("File", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wpbDrawBufferedFrame ); n++;
	XtSetArg( arg[n], XmNtopOffset, 8 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wslBufferedFrames ); n++;
	XtSetArg( arg[n], XmNleftOffset, 7 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNheight, 55 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFileBufferedFrame = XmCreatePushButton  (
			wformListBoxTop, "PushButton", arg, n);
	XtManageChild(wpbFileBufferedFrame);
	XtAddCallback( wpbFileBufferedFrame, XmNactivateCallback, 
			callbackFileFrame, 0 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Print", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wpbFileBufferedFrame ); n++;
	XtSetArg( arg[n], XmNtopOffset, 8 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wslBufferedFrames ); n++;
	XtSetArg( arg[n], XmNleftOffset, 7 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNheight, 55 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbPrintBufferedFrame = XmCreatePushButton  (
			wformListBoxTop, "PushButton", arg, n);
	XtManageChild(wpbPrintBufferedFrame);
	XtAddCallback( wpbPrintBufferedFrame, XmNactivateCallback, 
			callbackPrintFrame, 0 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Delete", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wpbPrintBufferedFrame ); n++;
	XtSetArg( arg[n], XmNtopOffset, 8 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wslBufferedFrames ); n++;
	XtSetArg( arg[n], XmNleftOffset, 7 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNheight, 55 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbDeleteBufferedFrame = XmCreatePushButton (
			wformListBoxTop, "PushButton", arg, n);
	XtManageChild(wpbDeleteBufferedFrame);
	XtAddCallback( wpbDeleteBufferedFrame, XmNactivateCallback, 
			callbackDeleteFrame, 0 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Graphics Out:", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
	XtSetArg( arg[n], XmNalignment, XmALIGNMENT_BEGINNING ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabGO = XmCreateLabel(wformListBoxBottom, "Label", arg, n);
	XtManageChild(wlabGO);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Graphics In:", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGO ); n++;
	XtSetArg( arg[n], XmNtopOffset, 3 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
	XtSetArg( arg[n], XmNalignment, XmALIGNMENT_BEGINNING ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabGI = XmCreateLabel(wformListBoxBottom, "Label", arg, n);
	XtManageChild(wlabGI);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR(" ", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabGO ); n++;
	XtSetArg( arg[n], XmNleftOffset, 5 ); n++;
	XtSetArg( arg[n], XmNalignment, XmALIGNMENT_BEGINNING ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabGraphicsOut = XmCreateLabel(
			wformListBoxBottom, "Label", arg, n);
	XtManageChild(wlabGraphicsOut);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR(" ", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGO ); n++;
	XtSetArg( arg[n], XmNtopOffset, 3 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabGO ); n++;
	XtSetArg( arg[n], XmNleftOffset, 5 ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightOffset, 0 ); n++;
	XtSetArg( arg[n], XmNalignment, XmALIGNMENT_BEGINNING ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabGraphicsIn = XmCreateLabel(
			wformListBoxBottom, "Label", arg, n);
	XtManageChild(wlabGraphicsIn);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Dismiss", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGI ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomOffset, 0 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbListBoxDismiss = XmCreatePushButton(
			wformListBoxBottom, "PushButton", arg, n);
	XtManageChild(wpbListBoxDismiss);
	XtAddCallback( wpbListBoxDismiss, XmNactivateCallback, 
			callbackDismiss, 50 );
	XmStringFree(xmstring);

/*
**  Frame Buffering popup.
*/

	xmstring = XmStringCreateLtoR("XTC Frame Buffering", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdFrameBuffering = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformFrameBuffering = XmCreateForm(
			wformdFrameBuffering, "Form", arg, n);
	XtManageChild(wformFrameBuffering);

	xmstring = XmStringCreateLtoR("Buffer Depth (# Frames)", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNorientation, XmHORIZONTAL); n++;
	XtSetArg( arg[n], XmNshowValue, TRUE); n++;
	XtSetArg( arg[n], XmNscaleWidth, 300 ); n++;
	XtSetArg( arg[n], XmNminimum, 1 ); n++;
	XtSetArg( arg[n], XmNmaximum, 100 ); n++;
	XtSetArg( arg[n], XmNtitleString, xmstring ); n++;
	wscaleBufferDepth = XmCreateScale(
			wformFrameBuffering, "wscale_Buffer_Depth", arg, n);
	XtManageChild(wscaleBufferDepth);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Multiple-Frame Draw-File-Print Order", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wscaleBufferDepth ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabMultiOrder = XmCreateLabel(
			wformFrameBuffering, "Label", arg, n);
	XtManageChild(wlabMultiOrder);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabMultiOrder ); n++;
	XtSetArg( arg[n], XmNtopOffset, 3 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 5 ); n++;
	wradioMultiOrder = XmCreateRadioBox(
			wformFrameBuffering, "RadioBox", arg, n);
	XtManageChild(wradioMultiOrder);

	xmstring = XmStringCreateLtoR("Top-Down (Newest-To-Oldest)", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogTopDown = XmCreateToggleButton(
			wradioMultiOrder, "wtog_Top_Down", arg, n);
	XtManageChild(wtogTopDown);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Bottom-Up (Oldest-To-Newest)", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogBottomUp = XmCreateToggleButton(
			wradioMultiOrder, "wtog_Bottom_Up", arg, n);
	XtManageChild(wtogBottomUp);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wradioMultiOrder ); n++;
	XtSetArg( arg[n], XmNtopOffset, 40 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameBufferingOK = XmCreatePushButton(
			wformFrameBuffering, "PushButton", arg, n);
	XtManageChild(wpbFrameBufferingOK);
	XtAddCallback( wpbFrameBufferingOK, XmNactivateCallback, 
			callbackOKACFrameBuffering, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wradioMultiOrder ); n++;
	XtSetArg( arg[n], XmNtopOffset, 40 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFrameBufferingOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameBufferingApply = XmCreatePushButton(
			wformFrameBuffering, "PushButton", arg, n);
	XtManageChild(wpbFrameBufferingApply);
	XtAddCallback( wpbFrameBufferingApply, XmNactivateCallback, 
			callbackOKACFrameBuffering, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wradioMultiOrder ); n++;
	XtSetArg( arg[n], XmNtopOffset, 40 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFrameBufferingApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameBufferingCancel = XmCreatePushButton(
			wformFrameBuffering, "PushButton", arg, n);
	XtManageChild(wpbFrameBufferingCancel);
	XtAddCallback( wpbFrameBufferingCancel, XmNactivateCallback, 
			callbackOKACFrameBuffering, 12 );
	XmStringFree(xmstring);

/*
**  Frame Filing popup.
*/

	xmstring = XmStringCreateLtoR("XTC Frame Filing", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdFrameFiling = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformFrameFiling = XmCreateForm(
			wformdFrameFiling, "Form", arg, n);
	XtManageChild(wformFrameFiling);

	xmstring = XmStringCreateLtoR("Filename", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 2 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabFrameFilename = XmCreateLabel(
			wformFrameFiling, "Label", arg, n);
	XtManageChild(wlabFrameFilename);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabFrameFilename ); n++;
	XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
	XtSetArg( arg[n], XmNcolumns, 40 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextFrameFilename = XmCreateText(
			wformFrameFiling, "wtext_Frame_Filename", arg, n);
	XtManageChild(wtextFrameFilename);

	xmstring = XmStringCreateLtoR(
			"Enter ``*'' in Filename to substitute frame label.", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextFrameFilename ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabFrameFilename ); n++;
	XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabFrameFilenameSub1 = XmCreateLabel(
			wformFrameFiling, "Label", arg, n);
	XtManageChild(wlabFrameFilenameSub1);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR(
			"Enter ``#'' in Filename to substitute frame number.",
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabFrameFilenameSub1 ); n++;
	XtSetArg( arg[n], XmNtopOffset, 2 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabFrameFilename ); n++;
	XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabFrameFilenameSub2 = XmCreateLabel(
			wformFrameFiling, "Label", arg, n);
	XtManageChild(wlabFrameFilenameSub2);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Auto File", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabFrameFilenameSub2 ); n++;
	XtSetArg( arg[n], XmNtopOffset, 12 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogAutoFile = XmCreateToggleButton(
			wformFrameFiling, "wtog_Auto_File", arg, n);
	XtManageChild(wtogAutoFile);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("PostScript File", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAutoFile); n++;
	XtSetArg( arg[n], XmNtopOffset, 12 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogPsFile = XmCreateToggleButton(
			wformFrameFiling, "wtog_Ps_File", arg, n);
	XtManageChild(wtogPsFile);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Append New Frames To Existing File", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogPsFile); n++;
	XtSetArg( arg[n], XmNtopOffset, 8 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogAppendFrames = XmCreateToggleButton(
			wformFrameFiling, "wtog_Append_Frames", arg, n);
	XtManageChild(wtogAppendFrames);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAppendFrames ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameFilingOK = XmCreatePushButton(
			wformFrameFiling, "PushButton", arg, n);
	XtManageChild(wpbFrameFilingOK);
	XtAddCallback( wpbFrameFilingOK, XmNactivateCallback, 
			callbackOKACFrameFiling, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAppendFrames ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFrameFilingOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameFilingApply = XmCreatePushButton(
			wformFrameFiling, "PushButton", arg, n);
	XtManageChild(wpbFrameFilingApply);
	XtAddCallback( wpbFrameFilingApply, XmNactivateCallback, 
			callbackOKACFrameFiling, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAppendFrames); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFrameFilingApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFrameFilingCancel = XmCreatePushButton(
			wformFrameFiling, "PushButton", arg, n);
	XtManageChild(wpbFrameFilingCancel);
	XtAddCallback( wpbFrameFilingCancel, XmNactivateCallback, 
			callbackOKACFrameFiling, 12 );
	XmStringFree(xmstring);

/*
**  Frame Printing.
*/

	xmstring = XmStringCreateLtoR("XTC Frame Printing", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdFramePrinting = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformFramePrinting = XmCreateForm(
			wformdFramePrinting, "Form", arg, n);
	XtManageChild(wformFramePrinting);

#ifdef VMS

	xmstring = XmStringCreateLtoR("Print Queue", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 2 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabQueue = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabQueue);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabQueue ); n++;
	XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
	XtSetArg( arg[n], XmNcolumns, 20 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextQueue = XmCreateText(
			wformFramePrinting, "wtext_Queue", arg, n);
	XtManageChild(wtextQueue);

	xmstring = XmStringCreateLtoR("Auto Print", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextQueue ); n++;
	XtSetArg( arg[n], XmNtopOffset, 12 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogAutoPrint = XmCreateToggleButton(
			wformFramePrinting, "wtog_Auto_Print", arg, n);
	XtManageChild(wtogAutoPrint);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Slave Printer Process Command File", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAutoPrint ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabCommandFile = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabCommandFile);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabCommandFile); n++;
	XtSetArg( arg[n], XmNtopOffset, 1 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNcolumns, 30 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextCommandFile = XmCreateText(
			wformFramePrinting, "wtext_Command_File", arg, n);
	XtManageChild(wtextCommandFile);

	xmstring = XmStringCreateLtoR(
			"DISK:[DIRECTORY] For Scratch Print File", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextCommandFile ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabScratchArea = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabScratchArea);
	XmStringFree(xmstring);

#else

	xmstring = XmStringCreateLtoR("Print Command", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 2 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabPrintCommand = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabPrintCommand);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabPrintCommand); n++;
	XtSetArg( arg[n], XmNtopOffset, 1 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNcolumns, 30 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextPrintCommand = XmCreateText(
			wformFramePrinting, "wtext_Print_Command", arg, n);
	XtManageChild(wtextPrintCommand);

	xmstring = XmStringCreateLtoR("Auto Print", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextPrintCommand ); n++;
	XtSetArg( arg[n], XmNtopOffset, 12 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogAutoPrint = XmCreateToggleButton(
			wformFramePrinting, "wtog_Auto_Print", arg, n);
	XtManageChild(wtogAutoPrint);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Directory of tek2ps prolog   ", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAutoPrint ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabCommandFile = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabCommandFile);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabCommandFile); n++;
	XtSetArg( arg[n], XmNtopOffset, 1 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNcolumns, 30 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextCommandFile = XmCreateText(
			wformFramePrinting, "wtext_Command_File", arg, n);
	XtManageChild(wtextCommandFile);


	xmstring = XmStringCreateLtoR("Scratch Print File Directory", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogAutoPrint ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabScratchArea = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabScratchArea);
	XmStringFree(xmstring);

#endif

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabScratchArea ); n++;
	XtSetArg( arg[n], XmNtopOffset, 1 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNcolumns, 30 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextScratchArea = XmCreateText(
			wformFramePrinting, "wtext_Scratch_Area", arg, n);
	XtManageChild(wtextScratchArea);

	xmstring = XmStringCreateLtoR(
			"Note: Scratch Print Filename is xtc_<datetime>.plt", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextScratchArea ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabPrintingNote = XmCreateLabel(
			wformFramePrinting, "Label", arg, n);
	XtManageChild(wlabPrintingNote);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabPrintingNote ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFramePrintingOK = XmCreatePushButton(
			wformFramePrinting, "PushButton", arg, n);
	XtManageChild(wpbFramePrintingOK);
	XtAddCallback( wpbFramePrintingOK, XmNactivateCallback, 
			callbackOKACFramePrinting, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabPrintingNote ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFramePrintingOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFramePrintingApply = XmCreatePushButton(
			wformFramePrinting, "PushButton", arg, n);
	XtManageChild(wpbFramePrintingApply);
	XtAddCallback( wpbFramePrintingApply, XmNactivateCallback, 
			callbackOKACFramePrinting, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabPrintingNote); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbFramePrintingApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbFramePrintingCancel = XmCreatePushButton(
			wformFramePrinting, "PushButton", arg, n);
	XtManageChild(wpbFramePrintingCancel);
	XtAddCallback( wpbFramePrintingCancel, XmNactivateCallback, 
			callbackOKACFramePrinting, 12 );
	XmStringFree(xmstring);

/*
** Control Sequences popup.
*/

	xmstring = XmStringCreateLtoR("XTC Control Sequences", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdControlSequences = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformControlSequences = XmCreateForm(
			wformdControlSequences, "Form", arg, n);
	XtManageChild(wformControlSequences);

	xmstring = XmStringCreateLtoR("INITT Byte Stream", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabINITT = XmCreateLabel(
			wformControlSequences, "Label", arg, n);
	XtManageChild(wlabINITT);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabINITT ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNcolumns, 2 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
	wtextINITT[0] = XmCreateText(
			wformControlSequences, "wtext_INITT_0", arg, n);
	XtManageChild(wtextINITT[0]);

	for (i = 1; i < 8; i++)
		{
		sprintf( resource, "wtext_INITT_%d\0", i);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wlabINITT ); n++;
		XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNleftWidget, wtextINITT[i-1] ); n++;
		XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
		XtSetArg( arg[n], XmNcolumns, 2 ); n++;
		XtSetArg( arg[n], XmNrows, 1 ); n++;
		XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
		wtextINITT[i] = XmCreateText(
				wformControlSequences, resource, arg, n);
		XtManageChild(wtextINITT[i]);
		}

	xmstring = XmStringCreateLtoR("FINITT Byte Stream", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextINITT[0] ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabFINITT = XmCreateLabel(
			wformControlSequences, "Label", arg, n);
	XtManageChild(wlabFINITT);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabFINITT ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNcolumns, 2 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
	wtextFINITT[0] = XmCreateText(
			wformControlSequences, "wtext_FINITT_0", arg, n);
	XtManageChild(wtextFINITT[0]);

	for (i = 1; i < 8; i++)
		{
		sprintf(resource, "wtext_FINITT_%d\0", i);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wlabFINITT ); n++;
		XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNleftWidget, wtextFINITT[i-1] ); n++;
		XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
		XtSetArg( arg[n], XmNcolumns, 2 ); n++;
		XtSetArg( arg[n], XmNrows, 1 ); n++;
		XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
		wtextFINITT[i] = XmCreateText(
				wformControlSequences, resource, arg, n);
		XtManageChild(wtextFINITT[i]);
		}

	xmstring = XmStringCreateLtoR("``Start-Of-Frame'' Byte Stream", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextFINITT[0] ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabSNP = XmCreateLabel(
			wformControlSequences, "Label", arg, n);
	XtManageChild(wlabSNP);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabSNP ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNcolumns, 2 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
	wtextSNP[0] = XmCreateText(
			wformControlSequences, "wtext_SNP_0", arg, n);
	XtManageChild(wtextSNP[0]);

	for (i = 1; i < 8; i++)
		{
		sprintf(resource, "wtext_SNP_%d\0", i);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wlabSNP ); n++;
		XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNleftWidget, wtextSNP[i-1] ); n++;
		XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
		XtSetArg( arg[n], XmNcolumns, 2 ); n++;
		XtSetArg( arg[n], XmNrows, 1 ); n++;
		XtSetArg( arg[n], XmNmaxLength, 2 ); n++;
		wtextSNP[i] = XmCreateText(
				wformControlSequences, resource, arg, n);
		XtManageChild(wtextSNP[i]);
		}

	xmstring = XmStringCreateLtoR("GIN Mode Expected # Of Bytes", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextSNP[0] ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabGINBytes = XmCreateLabel(
			wformControlSequences, "Label", arg, n);
	XtManageChild(wlabGINBytes);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGINBytes ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNcolumns, 1 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	XtSetArg( arg[n], XmNmaxLength, 1 ); n++;
	wtextGINBytes = XmCreateText(
			wformControlSequences, "wtext_GIN_Bytes", arg, n);
	XtManageChild(wtextGINBytes);

	xmstring = XmStringCreateLtoR("5", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGINBytes ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wtextGINBytes ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNwidth, 40 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbGINBytes5 = XmCreatePushButton(
			wformControlSequences, "PushButton", arg, n);
	XtManageChild(wpbGINBytes5);
	XtAddCallback( wpbGINBytes5, XmNactivateCallback, 
			callbackGINBytes, 5 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("6", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabGINBytes ); n++;
	XtSetArg( arg[n], XmNtopOffset, 5 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbGINBytes5 ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNwidth, 40 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbGINBytes6 = XmCreatePushButton(
			wformControlSequences, "PushButton", arg, n);
	XtManageChild(wpbGINBytes6);
	XtAddCallback( wpbGINBytes6, XmNactivateCallback, 
			callbackGINBytes, 6 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextGINBytes ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbControlSequencesOK = XmCreatePushButton(
			wformControlSequences, "PushButton", arg, n);
	XtManageChild(wpbControlSequencesOK);
	XtAddCallback( wpbControlSequencesOK, XmNactivateCallback, 
			callbackOKACControlSeqs, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextGINBytes ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbControlSequencesOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbControlSequencesApply = XmCreatePushButton(
			wformControlSequences, "PushButton", arg, n);
	XtManageChild(wpbControlSequencesApply);
	XtAddCallback( wpbControlSequencesApply, XmNactivateCallback, 
			callbackOKACControlSeqs, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextGINBytes); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbControlSequencesApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbControlSequencesCancel = XmCreatePushButton(
			wformControlSequences, "PushButton", arg, n);
	XtManageChild(wpbControlSequencesCancel);
	XtAddCallback( wpbControlSequencesCancel, XmNactivateCallback, 
			callbackOKACControlSeqs, 12 );
	XmStringFree(xmstring);

/*
**  Visibility popup.
*/

	xmstring = XmStringCreateLtoR("XTC Visibility", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdVisibility = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformVisibility = XmCreateForm(
			wformdVisibility, "Form", arg, n);
	XtManageChild(wformVisibility);

	xmstring = XmStringCreateLtoR("XTC Startup State", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabStartupState = XmCreateLabel(
			wformVisibility, "Label", arg, n);
	XtManageChild(wlabStartupState);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabStartupState ); n++;
	XtSetArg( arg[n], XmNtopOffset, 3 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 25 ); n++;
	wradioStartupState = XmCreateRadioBox(
			wformVisibility, "RadioBox", arg, n);
	XtManageChild(wradioStartupState);

	xmstring = XmStringCreateLtoR("Window", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogStartupWindow = XmCreateToggleButton(
			wradioStartupState, "wtog_Startup_Window", arg, n);
	XtManageChild(wtogStartupWindow);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Icon", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogStartupIcon = XmCreateToggleButton(
			wradioStartupState, "wtog_Startup_Icon", arg, n);
	XtManageChild(wtogStartupIcon);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("XTC List Box Policy (On Startup)", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wradioStartupState ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabListBoxPolicy = XmCreateLabel(
			wformVisibility, "Label", arg, n);
	XtManageChild(wlabListBoxPolicy);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabListBoxPolicy ); n++;
	XtSetArg( arg[n], XmNtopOffset, 3 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 25 ); n++;
	wradioListBoxPolicy = XmCreateRadioBox(
			wformVisibility, "RadioBox", arg, n);
	XtManageChild(wradioListBoxPolicy);

	xmstring = XmStringCreateLtoR("Constant", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogListBoxConstant = XmCreateToggleButton(
			wradioListBoxPolicy, "wtog_List_Box_Constant", arg, n);
	XtManageChild(wtogListBoxConstant);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Variable", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogListBoxVariable = XmCreateToggleButton(
			wradioListBoxPolicy, "wtog_List_Box_Variable", arg, n);
	XtManageChild(wtogListBoxVariable);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Display XTC MBX Data As It Is Read", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wradioListBoxPolicy ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogDisplayMBXData = XmCreateToggleButton(
			wformVisibility, "wtog_Display_MBX_Data", arg, n);
	XtManageChild(wtogDisplayMBXData);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Display Plot File Data As It Is Read", 
			xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogDisplayMBXData ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogDisplayPlotfileData = XmCreateToggleButton(
			wformVisibility, "wtog_Display_Plotfile_Data", arg, n);
	XtManageChild(wtogDisplayPlotfileData);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogDisplayPlotfileData ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbVisibilityOK = XmCreatePushButton(
			wformVisibility, "PushButton", arg, n);
	XtManageChild(wpbVisibilityOK);
	XtAddCallback( wpbVisibilityOK, XmNactivateCallback, 
			callbackOKACVisibility, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogDisplayPlotfileData ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbVisibilityOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbVisibilityApply = XmCreatePushButton(
			wformVisibility, "PushButton", arg, n);
	XtManageChild(wpbVisibilityApply);
	XtAddCallback( wpbVisibilityApply, XmNactivateCallback, 
			callbackOKACVisibility, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtogDisplayPlotfileData); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbVisibilityApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbVisibilityCancel = XmCreatePushButton(
			wformVisibility, "PushButton", arg, n);
	XtManageChild(wpbVisibilityCancel);
	XtAddCallback( wpbVisibilityCancel, XmNactivateCallback, 
			callbackOKACVisibility, 12 );
	XmStringFree(xmstring);

/*
**  Colors popup.
*/

	xmstring = XmStringCreateLtoR("XTC Tek Window Colors", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdColors = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformColors = XmCreateForm(
			wformdColors, "Form", arg, n);
	XtManageChild(wformColors);

	xmstring = XmStringCreateLtoR(" ", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 256 ); n++;
	XtSetArg( arg[n], XmNheight, 40 ); n++;
	XtSetArg( arg[n], XmNborderWidth, 1 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabMixer = XmCreateLabel(
			wformColors, "Label", arg, n);
	XtManageChild(wlabMixer);
	XmStringFree(xmstring);

	for (i = 0; i < 9; i++)
		{
		if (i == 8) 
			sprintf(resource, "wscale_Background_Red_V4\0");
		else        
			sprintf(resource, "wscale_Foreground%d_Red_V4\0", i);
		xmstring = XmStringCreateLtoR("Red", xtc_charset);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wlabMixer ); n++;
		XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
		XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
		XtSetArg( arg[n], XmNorientation, XmHORIZONTAL ); n++;
		XtSetArg( arg[n], XmNshowValue, TRUE ); n++;
		XtSetArg( arg[n], XmNscaleWidth, 256 ); n++;
		XtSetArg( arg[n], XmNminimum, 0 ); n++;
		XtSetArg( arg[n], XmNmaximum, 255 ); n++;
		XtSetArg( arg[n], XmNtitleString, xmstring ); n++;
		wscaleRed[i] = XmCreateScale(wformColors, resource, arg, n);
		XtManageChild(wscaleRed[i]);
		XtAddCallback( wscaleRed[i], XmNdragCallback, 
				callbackColorMix, 10 );
		XtAddCallback( wscaleRed[i], XmNvalueChangedCallback, 
				callbackColorMix, 10 );
		XmStringFree(xmstring);

		if (i == 8) 
			sprintf(resource, "wscale_Background_Green_V4\0");
		else        
			sprintf(resource, "wscale_Foreground%d_Green_V4\0", i);
		xmstring = XmStringCreateLtoR("Green", xtc_charset);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wscaleRed[i] ); n++;
		XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
		XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
		XtSetArg( arg[n], XmNorientation, XmHORIZONTAL ); n++;
		XtSetArg( arg[n], XmNshowValue, TRUE ); n++;
		XtSetArg( arg[n], XmNscaleWidth, 256 ); n++;
		XtSetArg( arg[n], XmNminimum, 0 ); n++;
		XtSetArg( arg[n], XmNmaximum, 255 ); n++;
		XtSetArg( arg[n], XmNtitleString, xmstring ); n++;
		wscaleGreen[i] = XmCreateScale(wformColors, resource, arg, n);
		XtManageChild(wscaleGreen[i]);
		XtAddCallback( wscaleGreen[i], XmNdragCallback, 
				callbackColorMix, 20 );
		XtAddCallback( wscaleGreen[i], XmNvalueChangedCallback, 
				callbackColorMix, 20 );
		XmStringFree(xmstring);

		if (i == 8) 
			sprintf(resource, "wscale_Background_Blue_V4\0");
		else        
			sprintf(resource, "wscale_Foreground%d_Blue_V4\0", i);
		xmstring = XmStringCreateLtoR("Blue", xtc_charset);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wscaleGreen[i] ); n++;
		XtSetArg( arg[n], XmNtopOffset, 0 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
		XtSetArg( arg[n], XmNleftOffset, 0 ); n++;
		XtSetArg( arg[n], XmNorientation, XmHORIZONTAL ); n++;
		XtSetArg( arg[n], XmNshowValue, TRUE ); n++;
		XtSetArg( arg[n], XmNscaleWidth, 256 ); n++;
		XtSetArg( arg[n], XmNminimum, 0 ); n++;
		XtSetArg( arg[n], XmNmaximum, 255 ); n++;
		XtSetArg( arg[n], XmNtitleString, xmstring ); n++;
		wscaleBlue[i] = XmCreateScale(wformColors, resource, arg, n);
		XtManageChild(wscaleBlue[i]);
		XtAddCallback( wscaleBlue[i], XmNdragCallback, 
				callbackColorMix, 30 );
		XtAddCallback( wscaleBlue[i], XmNvalueChangedCallback, 
				callbackColorMix, 30 );
		XmStringFree(xmstring);
		}

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabMixer ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomOffset, 10 ); n++;
	wradioFB = XmCreateRadioBox(wformColors, "RadioBox", arg, n);
	XtManageChild(wradioFB);

	xmstring = XmStringCreateLtoR("Background", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wtogGround[8] = XmCreateToggleButton(
			wradioFB, "Toggle", arg, n);
	XtManageChild(wtogGround[8]);
	XtAddCallback( wtogGround[8], XmNvalueChangedCallback, 
			callbackColorFB, 8 );
	XmStringFree(xmstring);

	for (i = 0; i < 8; i++)
		{
		sprintf(string, "Foreground %d\0", i);
		if (i == 0) strcpy(string, "Foreground 0 (Default)");
		xmstring = XmStringCreateLtoR(string, xtc_charset);
		n = 0;
		XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
		wtogGround[i] = XmCreateToggleButton(
				wradioFB, "Toggle", arg, n);
		XtManageChild(wtogGround[i]);
		XtAddCallback( wtogGround[i], XmNvalueChangedCallback, 
				callbackColorFB, i );
		XmStringFree(xmstring);
		}

	xmstring = XmStringCreateLtoR("Dismiss", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbColorsDismiss = XmCreatePushButton(
			wformColors, "PushButton", arg, n);
	XtManageChild(wpbColorsDismiss);
	XtAddCallback( wpbColorsDismiss, XmNactivateCallback, 
			callbackDismiss, 40 );
	XmStringFree(xmstring);

/*
**  Byte Stream popup.
*/

	xmstring = XmStringCreateLtoR("XTC Byte Stream", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdByteStream = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformByteStream = XmCreateForm(
			wformdByteStream, "Form", arg, n);
	XtManageChild(wformByteStream);

	xmstring = XmStringCreateLtoR("*", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabByteStreamDump = XmCreateLabel(
			wformByteStream, "Label", arg, n);
	XtManageChild(wlabByteStreamDump);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Dismiss", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabByteStreamDump ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbByteStreamDismiss = XmCreatePushButton(
			wformByteStream, "PushButton", arg, n);
	XtManageChild(wpbByteStreamDismiss);
	XtAddCallback( wpbByteStreamDismiss, XmNactivateCallback, 
			callbackDismiss, 10 );
	XmStringFree(xmstring);

/*
**  Read Plot File popup.
*/

	xmstring = XmStringCreateLtoR("XTC Read Plot File", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wfiledReadPlotFile = XmCreateFileSelectionDialog(
			wshell, "wfiled_Read_Plot_File", arg, n);
	XtAddCallback( wfiledReadPlotFile, XmNokCallback, 
			callbackReadPlotFile, 10 );
	XtAddCallback( wfiledReadPlotFile, XmNcancelCallback, 
			callbackReadPlotFile, 20 );
	XmStringFree(xmstring);

/*
**  About XTC popup.
*/

	xmstring = XmStringCreateLtoR("About XTC", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdAboutXTC = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformAboutXTC = XmCreateForm(
			wformdAboutXTC, "Form", arg, n);
	XtManageChild(wformAboutXTC);

	xmstring = XmStringCreateLtoR(xtc_version, xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabAboutXTCVersion = XmCreateLabel(
			wformAboutXTC, "Label", arg, n);
	XtManageChild(wlabAboutXTCVersion);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabAboutXTCVersion ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelType, XmPIXMAP ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 0 ); n++;
	wlabAboutXTCArm = XmCreateLabel(
			wformAboutXTC, "Label", arg, n);
	XtManageChild(wlabAboutXTCArm);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabAboutXTCVersion ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabAboutXTCArm ); n++;
	XtSetArg( arg[n], XmNleftOffset, 0); n++;
	XtSetArg( arg[n], XmNlabelType, XmPIXMAP ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 0 ); n++;
	wlabAboutXTCBody = XmCreateLabel(
			wformAboutXTC, "Label", arg, n);
	XtManageChild(wlabAboutXTCBody);

	xmstring = XmStringCreateLtoR("Dismiss", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabAboutXTCArm ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbAboutXTCDismiss = XmCreatePushButton(
			wformAboutXTC, "PushButton", arg, n);
	XtManageChild(wpbAboutXTCDismiss);
	XtAddCallback( wpbAboutXTCDismiss, XmNactivateCallback, 
			callbackDismiss, 20 );
	XmStringFree(xmstring);

/*
**  Clear Frame Buffer popup.
*/

	xmstring = XmStringCreateLtoR("XTC Clear Frame Buffer", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdClearFrameBuffer = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformClearFrameBuffer = XmCreateForm(
			wformdClearFrameBuffer, "Form", arg, n);
	XtManageChild(wformClearFrameBuffer);

	xmstring = XmStringCreateLtoR("Reset Frame Number?", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabResetFrameNumber = XmCreateLabel(
			wformClearFrameBuffer, "Label", arg, n);
	XtManageChild(wlabResetFrameNumber);
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Yes", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabResetFrameNumber ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftOffset, 10 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbResetFrameNumberYes = XmCreatePushButton(
			wformClearFrameBuffer, "PushButton", arg, n);
	XtManageChild(wpbResetFrameNumberYes);
	XtAddCallback( wpbResetFrameNumberYes, XmNactivateCallback, 
			callbackClearFrameBuffer, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("No", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabResetFrameNumber ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbResetFrameNumberYes ); n++;
	XtSetArg( arg[n], XmNleftOffset, 15 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbResetFrameNumberNo = XmCreatePushButton(
			wformClearFrameBuffer, "PushButton", arg, n);
	XtManageChild(wpbResetFrameNumberNo);
	XtAddCallback( wpbResetFrameNumberNo, XmNactivateCallback, 
			callbackClearFrameBuffer, 20 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabResetFrameNumber ); n++;
	XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbResetFrameNumberNo ); n++;
	XtSetArg( arg[n], XmNleftOffset, 15 ); n++;
	XtSetArg( arg[n], XmNwidth, 100 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbResetFrameNumberCancel = XmCreatePushButton(
			wformClearFrameBuffer, "PushButton", arg, n);
	XtManageChild(wpbResetFrameNumberCancel);
	XtAddCallback( wpbResetFrameNumberCancel, XmNactivateCallback, 
			callbackClearFrameBuffer, 30 );
	XmStringFree(xmstring);

/*
**  Messages popup (separate instance tree).
*/

	xmstring = XmStringCreateLtoR("XTC Error Messages", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdMessages = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformMessages = XmCreateForm(
			wformdMessages, "Form", arg, n);
	XtManageChild(wformMessages);

	xmstring = XmStringCreateLtoR(" ", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabMessages[0] = XmCreateLabel(
			wformMessages, "Label", arg, n);
	XtManageChild(wlabMessages[0]);
	XmStringFree(xmstring);

	for (i = 1; i < 5; i++)
		{
		xmstring = XmStringCreateLtoR(" ", xtc_charset);
		n = 0;
		XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
		XtSetArg( arg[n], XmNtopWidget, wlabMessages[i-1] ); n++;
		XtSetArg( arg[n], XmNtopOffset, 10 ); n++;
		XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
		XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
		wlabMessages[i] = XmCreateLabel(
				wformMessages, "Label", arg, n);
		XtManageChild(wlabMessages[i]);
		XmStringFree(xmstring);
		}

	xmstring = XmStringCreateLtoR("Dismiss", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wlabMessages[4] ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbMessagesDismiss = XmCreatePushButton(
			wformMessages, "PushButton", arg, n);
	XtManageChild(wpbMessagesDismiss);
	XtAddCallback( wpbMessagesDismiss, XmNactivateCallback, 
			callbackDismiss, 30 );
	XmStringFree(xmstring);

/*
**  Rename Frame popup (separate instance tree).
*/

	xmstring = XmStringCreateLtoR("XTC RenameFrame", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNunitType, XmPIXELS ); n++;
	XtSetArg( arg[n], XmNdefaultPosition, TRUE ); n++;
	XtSetArg( arg[n], XmNautoUnmanage, FALSE ); n++;
	XtSetArg( arg[n], XmNmarginHeight, 10 ); n++;
	XtSetArg( arg[n], XmNmarginWidth, 10 ); n++;
	XtSetArg( arg[n], XmNdialogTitle, xmstring ); n++;
	wformdRenameFrame = XmCreateFormDialog(
			wshell, "FormDialog", arg, n);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNrightAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNbottomAttachment, XmATTACH_FORM ); n++;
	wformRenameFrame = XmCreateForm(
			wformdRenameFrame, "Form", arg, n);
	XtManageChild(wformRenameFrame);

	xmstring = XmStringCreateLtoR("New Frame Label", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNtopOffset, 2 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wlabFrameID = XmCreateLabel(
			wformRenameFrame, "Label", arg, n);
	XtManageChild(wlabFrameID);
	XmStringFree(xmstring);

	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wlabFrameID ); n++;
	XtSetArg( arg[n], XmNleftOffset, 3 ); n++;
	XtSetArg( arg[n], XmNcolumns, 25 ); n++;
	XtSetArg( arg[n], XmNrows, 1 ); n++;
	wtextFrameID = XmCreateText(
			wformRenameFrame, "Text", arg, n);
	XtManageChild(wtextFrameID);
	XtAddCallback( wtextFrameID, XmNactivateCallback, 
			callbackOKACRenameFrame, 10 );

	xmstring = XmStringCreateLtoR("OK", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextFrameID ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_FORM ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbRenameFrameOK = XmCreatePushButton(
			wformRenameFrame, "PushButton", arg, n);
	XtManageChild(wpbRenameFrameOK);
	XtAddCallback( wpbRenameFrameOK, XmNactivateCallback, 
			callbackOKACRenameFrame, 10 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Apply", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextFrameID ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbRenameFrameOK ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbRenameFrameApply = XmCreatePushButton(
			wformRenameFrame, "PushButton", arg, n);
	XtManageChild(wpbRenameFrameApply);
	XtAddCallback( wpbRenameFrameApply, XmNactivateCallback, 
			callbackOKACRenameFrame, 11 );
	XmStringFree(xmstring);

	xmstring = XmStringCreateLtoR("Cancel", xtc_charset);
	n = 0;
	XtSetArg( arg[n], XmNtopAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNtopWidget, wtextFrameID ); n++;
	XtSetArg( arg[n], XmNtopOffset, 20 ); n++;
	XtSetArg( arg[n], XmNleftAttachment, XmATTACH_WIDGET ); n++;
	XtSetArg( arg[n], XmNleftWidget, wpbRenameFrameApply ); n++;
	XtSetArg( arg[n], XmNleftOffset, 20 ); n++;
	XtSetArg( arg[n], XmNwidth, 80 ); n++;
	XtSetArg( arg[n], XmNshadowThickness, 5 ); n++;
	XtSetArg( arg[n], XmNlabelString, xmstring ); n++;
	wpbRenameFrameCancel = XmCreatePushButton(
			wformRenameFrame, "PushButton", arg, n);
	XtManageChild(wpbRenameFrameCancel);
	XtAddCallback( wpbRenameFrameCancel, XmNactivateCallback, 
			callbackOKACRenameFrame, 12 );
	XmStringFree(xmstring);

	}
