/***************************** LICENSE START ***********************************

 Copyright 2012 ECMWF and INPE. This software is distributed under the terms
 of the Apache License version 2.0. In applying this license, ECMWF does not
 waive the privileges and immunities granted to it by virtue of its status as
 an Intergovernmental Organization or submit itself to any jurisdiction.

 ***************************** LICENSE END *************************************/

/*
** Generated by X-Designer
*/
/*
**LIBS: -lXm -lXt -lX11
*/

#include <stdlib.h>
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>

#include <Xm/Xm.h>
#include <Xm/CascadeB.h>
#include <Xm/DialogS.h>
#include <Xm/DrawingA.h>
#include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/List.h>
#include <Xm/PanedW.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/ScrollBar.h>
#include <Xm/ScrolledW.h>
#include <Xm/Separator.h>
#include <Xm/TextF.h>
#include <Xm/ToggleB.h>
#include <Xm/CascadeBG.h>
#include <Xm/LabelG.h>

#include <Drag.h>
#define XmCreateDrawingArea CreateDragWidget

#include "stbase.h"

extern void help_callback(Widget, XtPointer, XtPointer) ;
extern void text_activate_callback(Widget, XtPointer, XtPointer) ;
extern void list_browse_callback(Widget, XtPointer, XtPointer) ;
extern void quit_callback(Widget, XtPointer, XtPointer) ;
extern void plot_sel_callback(Widget, XtPointer, XtPointer) ;
extern void plot_all_callback(Widget, XtPointer, XtPointer) ;
extern void clear_callback(Widget, XtPointer, XtPointer) ;
extern void names_callback(Widget, XtPointer, XtPointer) ;

Widget xd_links [ 5 ];

void XDmanage_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtManageChild ( *(Widget *)client_data );
}

void XDunmanage_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtUnmanageChild ( *(Widget *)client_data );
}

void XDpopup_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtPopup ( *(Widget *)client_data, XtGrabNone );
}

void XDpopdown_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtPopdown ( *(Widget *)client_data );
}

void XDmap_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtMapWidget (*(Widget *)client_data);
}

void XDunmap_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtUnmapWidget (*(Widget *)client_data);
}

void XDenable_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtSetSensitive (*(Widget *)client_data, TRUE);
}

void XDdisable_link ( Widget w, XtPointer client_data, XtPointer call_data )
{
	if ( client_data && *(Widget *)client_data )
		XtSetSensitive (*(Widget *)client_data, FALSE);
}

Widget top = (Widget) NULL;
Widget form = (Widget) NULL;
Widget label_info = (Widget) NULL;
Widget sub_form = (Widget) NULL;
Widget search_option = (Widget) NULL;
Widget search_menu = (Widget) NULL;
Widget row_pos = (Widget) NULL;
Widget label_lat = (Widget) NULL;
Widget text_lat = (Widget) NULL;
Widget label2 = (Widget) NULL;
Widget text_lon = (Widget) NULL;
Widget label_thr = (Widget) NULL;
Widget text_thr = (Widget) NULL;
Widget row_area = (Widget) NULL;
Widget label_n = (Widget) NULL;
Widget text_n = (Widget) NULL;
Widget label_w = (Widget) NULL;
Widget text_w = (Widget) NULL;
Widget label_s = (Widget) NULL;
Widget text_s = (Widget) NULL;
Widget label_e = (Widget) NULL;
Widget text_e = (Widget) NULL;
Widget row_name = (Widget) NULL;
Widget text_name = (Widget) NULL;
Widget row_ident = (Widget) NULL;
Widget text_ident = (Widget) NULL;
Widget row_wmo = (Widget) NULL;
Widget text_wmo = (Widget) NULL;
Widget drag = (Widget) NULL;
Widget list_stbase = (Widget) NULL;
Widget plot_sel_button = (Widget) NULL;
Widget plot_all_button = (Widget) NULL;
Widget helpw = (Widget) NULL;



void create_top (Display *display, char *app_name, int app_argc, char **app_argv)
{
	Widget children[8];      /* Children to manage */
	Arg al[64];                    /* Arg List */
	register int ac = 0;           /* Arg Count */
	XtPointer tmp_value;             /* ditto */
	XmString xmstrings[16];    /* temporary storage for XmStrings */
	Widget label1 = (Widget)NULL;
	Widget cascade1 = (Widget)NULL;
	Widget button1 = (Widget)NULL;
	Widget button2 = (Widget)NULL;
	Widget button3 = (Widget)NULL;
	Widget button4 = (Widget)NULL;
	Widget button5 = (Widget)NULL;
	Widget panedWindow1 = (Widget)NULL;
	Widget scrolledWin1 = (Widget)NULL;
	Widget scrollbar1 = (Widget)NULL;
	Widget scrollbar2 = (Widget)NULL;
	Widget scrolledList1 = (Widget)NULL;
	Widget button6 = (Widget)NULL;
	Widget separator1 = (Widget)NULL;
	Widget menuBar1 = (Widget)NULL;
	Widget cascade2 = (Widget)NULL;
	Widget menu1 = (Widget)NULL;
	Widget button7 = (Widget)NULL;
	Widget cascade3 = (Widget)NULL;
	Widget menu2 = (Widget)NULL;
	Widget separator2 = (Widget)NULL;
	Widget toggle1 = (Widget)NULL;
	Widget toggle2 = (Widget)NULL;

	XtSetArg(al[ac], XmNallowShellResize, FALSE); ac++;
	XtSetArg(al[ac], XmNtitle, "Metview Stations Database"); ac++;
	XtSetArg(al[ac], XmNargc, app_argc); ac++;
	XtSetArg(al[ac], XmNargv, app_argv); ac++;
	top = XtAppCreateShell ( app_name, "Metview", applicationShellWidgetClass, display, al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++;
	form = XmCreateForm ( top, "form", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
	label_info = XmCreateLabel ( form, "label_info", al, ac );
	ac = 0;
	sub_form = XmCreateForm ( form, "sub_form", al, ac );
	search_option = XmCreateOptionMenu ( sub_form, "search_option", al, ac );
	label1 = XmOptionLabelGadget ( search_option );
	cascade1 = XmOptionButtonGadget ( search_option );
	XtSetArg(al[ac], XmNx, 3); ac++;
	XtSetArg(al[ac], XmNy, 3); ac++;
	XtSetValues ( label1,al, ac );
	ac = 0;
	search_menu = XmCreatePulldownMenu ( search_option, "search_menu", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Search by Name", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button1 = XmCreatePushButton ( search_menu, "NAME", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Search by Identifier", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button2 = XmCreatePushButton ( search_menu, "IDENT", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Search by WMO block", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button3 = XmCreatePushButton ( search_menu, "WMO_BLOCK", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Search by Position", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button4 = XmCreatePushButton ( search_menu, "POSITION", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Search by Area", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button5 = XmCreatePushButton ( search_menu, "AREA", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNx, 10); ac++;
	XtSetArg(al[ac], XmNy, 3); ac++;
	XtSetValues ( cascade1,al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNnumColumns, 0); ac++;
	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	row_pos = XmCreateRowColumn ( sub_form, "POSITION", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNwidth, 28); ac++;
	XtSetArg(al[ac], XmNheight, 29); ac++;
	xmstrings[0] = XmStringCreateLtoR ( "Lat", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	XtSetArg(al[ac], XmNrecomputeSize, TRUE); ac++;
	label_lat = XmCreateLabel ( row_pos, "label_lat", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNwidth, 37); ac++;
	XtSetArg(al[ac], XmNheight, 29); ac++;
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_lat = XmCreateTextField ( row_pos, "P", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_lat, "51.38" );
	xmstrings[0] = XmStringCreateLtoR ( "Lon", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label2 = XmCreateLabel ( row_pos, "label2", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_lon = XmCreateTextField ( row_pos, "P", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_lon, "-0.78" );
	XtSetArg(al[ac], XmNwidth, 30); ac++;
	XtSetArg(al[ac], XmNheight, 30); ac++;
	xmstrings[0] = XmStringCreateLtoR ( "Toler", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label_thr = XmCreateLabel ( row_pos, "label_thr", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNwidth, 76); ac++;
	XtSetArg(al[ac], XmNheight, 31); ac++;
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_thr = XmCreateTextField ( row_pos, "P", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_thr, "0.5" );
	xd_links [3] = row_pos;
	XtSetArg(al[ac], XmNnumColumns, 0); ac++;
	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	row_area = XmCreateRowColumn ( sub_form, "AREA", al, ac );
	ac = 0;
	xmstrings[0] = XmStringCreateLtoR ( "N", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label_n = XmCreateLabel ( row_area, "label_n", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_n = XmCreateTextField ( row_area, "A", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_n, "52.0" );
	xmstrings[0] = XmStringCreateLtoR ( "W", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label_w = XmCreateLabel ( row_area, "label_w", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_w = XmCreateTextField ( row_area, "A", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_w, "-1.0" );
	xmstrings[0] = XmStringCreateLtoR ( "S", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label_s = XmCreateLabel ( row_area, "label_s", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_s = XmCreateTextField ( row_area, "A", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_s, "51.0" );
	xmstrings[0] = XmStringCreateLtoR ( "E", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNalignment, XmALIGNMENT_END); ac++;
	label_e = XmCreateLabel ( row_area, "label_e", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNcolumns, 7); ac++;
	text_e = XmCreateTextField ( row_area, "A", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_e, "0.0" );
	xd_links [2] = row_area;
	XtSetArg(al[ac], XmNnumColumns, 0); ac++;
	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	row_name = XmCreateRowColumn ( sub_form, "NAME", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNcolumns, 20); ac++;
	text_name = XmCreateTextField ( row_name, "N", al, ac );
	ac = 0;
	xd_links [4] = row_name;
	XtSetArg(al[ac], XmNnumColumns, 0); ac++;
	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	row_ident = XmCreateRowColumn ( sub_form, "IDENT", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNcolumns, 5); ac++;
	text_ident = XmCreateTextField ( row_ident, "I", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_ident, "03772" );
	xd_links [1] = row_ident;
	XtSetArg(al[ac], XmNnumColumns, 0); ac++;
	XtSetArg(al[ac], XmNspacing, 0); ac++;
	XtSetArg(al[ac], XmNmarginWidth, 0); ac++;
	XtSetArg(al[ac], XmNmarginHeight, 0); ac++;
	XtSetArg(al[ac], XmNorientation, XmHORIZONTAL); ac++;
	XtSetArg(al[ac], XmNpacking, XmPACK_TIGHT); ac++;
	row_wmo = XmCreateRowColumn ( sub_form, "WMO_BLOCK", al, ac );
	ac = 0;
	XtSetArg(al[ac], XmNcolumns, 5); ac++;
	text_wmo = XmCreateTextField ( row_wmo, "W", al, ac );
	ac = 0;
	XmTextFieldSetString ( text_wmo, "03" );
	xd_links [0] = row_wmo;
	panedWindow1 = XmCreatePanedWindow ( form, "panedWindow1", al, ac );
	XtSetArg(al[ac], XmNscrollBarDisplayPolicy, XmSTATIC); ac++;
	XtSetArg(al[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
	scrolledWin1 = XmCreateScrolledWindow ( panedWindow1, "scrolledWin1", al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNhorizontalScrollBar, &scrollbar1); ac++;
	XtSetArg(al[ac], XmNverticalScrollBar, &scrollbar2); ac++;
	XtGetValues(scrolledWin1, al, ac );
	ac = 0;
	drag = XmCreateDrawingArea ( scrolledWin1, "drag", al, ac );
	XtSetArg(al[ac], XmNvisibleItemCount, 11); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ac++;
	list_stbase = XmCreateScrolledList ( panedWindow1, "list_stbase", al, ac );
	ac = 0;
	scrolledList1 = XtParent ( list_stbase );

	XtSetArg(al[ac], XmNvisibleItemCount, 11); ac++;
	XtSetArg(al[ac], XmNlistSizePolicy, XmRESIZE_IF_POSSIBLE); ac++;
	XtSetValues ( list_stbase,al, ac );
	ac = 0;
	xmstrings[0] = XmStringCreateLtoR ( "Close", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNmarginTop, 5); ac++;
	XtSetArg(al[ac], XmNmarginBottom, 5); ac++;
	XtSetArg(al[ac], XmNmarginLeft, 5); ac++;
	XtSetArg(al[ac], XmNmarginRight, 5); ac++;
	button6 = XmCreatePushButton ( form, "button6", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	separator1 = XmCreateSeparator ( form, "separator1", al, ac );
	menuBar1 = XmCreateMenuBar ( form, "menuBar1", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "File", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	cascade2 = XmCreateCascadeButton ( menuBar1, "cascade2", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	menu1 = XmCreatePulldownMenu ( menuBar1, "menu1", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Close", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	button7 = XmCreatePushButton ( menu1, "button7", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Plot", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	cascade3 = XmCreateCascadeButton ( menuBar1, "cascade3", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	menu2 = XmCreatePulldownMenu ( menuBar1, "menu2", al, ac );
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	xmstrings[0] = XmStringCreateLtoR ( "Selection", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	plot_sel_button = XmCreatePushButton ( menu2, "plot_sel_button", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNsensitive, FALSE); ac++;
	xmstrings[0] = XmStringCreateLtoR ( "All", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	plot_all_button = XmCreatePushButton ( menu2, "plot_all_button", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	separator2 = XmCreateSeparator ( menu2, "separator2", al, ac );
	xmstrings[0] = XmStringCreateLtoR ( "Clear plot window", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	XtSetArg(al[ac], XmNset, TRUE); ac++;
	toggle1 = XmCreateToggleButton ( menu2, "toggle1", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Names", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	toggle2 = XmCreateToggleButton ( menu2, "toggle2", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	xmstrings[0] = XmStringCreateLtoR ( "Help", (XmStringCharSet)XmFONTLIST_DEFAULT_TAG );
	XtSetArg(al[ac], XmNlabelString, xmstrings[0]); ac++;
	helpw = XmCreateCascadeButton ( menuBar1, "helpw", al, ac );
	ac = 0;
	XmStringFree ( xmstrings [ 0 ] );
	XtSetArg(al[ac], XmNmenuHelpWidget, helpw); ac++;
	XtSetValues ( menuBar1,al, ac );
	ac = 0;


	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, separator1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNrightWidget, button6); ac++;
	XtSetValues ( label_info,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, separator1); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( sub_form,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNtopWidget, menuBar1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, sub_form); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( panedWindow1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( button6,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNbottomOffset, 5); ac++;
	XtSetArg(al[ac], XmNbottomWidget, button6); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 5); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightOffset, 5); ac++;
	XtSetValues ( separator1,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( menuBar1,al, ac );
	ac = 0;
	if (form)
		XtAddCallback( form, XmNhelpCallback, help_callback, (XtPointer) 0 );

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 0); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 1); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( search_option,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, 2); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 187); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( row_pos,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNtopOffset, -1); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNleftOffset, 186); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_NONE); ac++;
	XtSetValues ( row_area,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNleftWidget, search_option); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( row_name,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNleftWidget, search_option); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( row_ident,al, ac );
	ac = 0;

	XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
	XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
	XtSetArg(al[ac], XmNleftAttachment, XmATTACH_WIDGET); ac++;
	XtSetArg(al[ac], XmNleftWidget, search_option); ac++;
	XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
	XtSetValues ( row_wmo,al, ac );
	ac = 0;
	XtAddCallback (button1,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[0] );
	XtAddCallback (button1,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button1,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[2] );
	XtAddCallback (button1,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[3] );
	XtAddCallback (button1,XmNactivateCallback, XDmanage_link, (XtPointer) &xd_links[4] );
	XtAddCallback (button2,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[0] );
	XtAddCallback (button2,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[4] );
	XtAddCallback (button2,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[2] );
	XtAddCallback (button2,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[3] );
	XtAddCallback (button2,XmNactivateCallback, XDmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button3,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[3] );
	XtAddCallback (button3,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[2] );
	XtAddCallback (button3,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[4] );
	XtAddCallback (button3,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button3,XmNactivateCallback, XDmanage_link, (XtPointer) &xd_links[0] );
	XtAddCallback (button4,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[0] );
	XtAddCallback (button4,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button4,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[4] );
	XtAddCallback (button4,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[2] );
	XtAddCallback (button4,XmNactivateCallback, XDmanage_link, (XtPointer) &xd_links[3] );
	XtAddCallback (button5,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[0] );
	XtAddCallback (button5,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[1] );
	XtAddCallback (button5,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[4] );
	XtAddCallback (button5,XmNactivateCallback, XDunmanage_link, (XtPointer) &xd_links[3] );
	XtAddCallback (button5,XmNactivateCallback, XDmanage_link, (XtPointer) &xd_links[2] );
	children[ac++] = button1;
	children[ac++] = button2;
	children[ac++] = button3;
	children[ac++] = button4;
	children[ac++] = button5;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, search_menu); ac++;
	XtSetValues(cascade1, al, ac );
	ac = 0;
	if (text_lat)
		XtAddCallback( text_lat, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	if (text_lon)
		XtAddCallback( text_lon, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	if (text_thr)
		XtAddCallback( text_thr, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	children[ac++] = label_lat;
	children[ac++] = text_lat;
	children[ac++] = label2;
	children[ac++] = text_lon;
	children[ac++] = label_thr;
	children[ac++] = text_thr;
	XtManageChildren(children, ac);
	ac = 0;
	if (text_n)
		XtAddCallback( text_n, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	if (text_w)
		XtAddCallback( text_w, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	if (text_s)
		XtAddCallback( text_s, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	if (text_e)
		XtAddCallback( text_e, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	children[ac++] = label_n;
	children[ac++] = text_n;
	children[ac++] = label_w;
	children[ac++] = text_w;
	children[ac++] = label_s;
	children[ac++] = text_s;
	children[ac++] = label_e;
	children[ac++] = text_e;
	XtManageChildren(children, ac);
	ac = 0;
	if (text_name)
		XtAddCallback( text_name, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	children[ac++] = text_name;
	XtManageChildren(children, ac);
	ac = 0;
	if (text_ident)
		XtAddCallback( text_ident, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	children[ac++] = text_ident;
	XtManageChildren(children, ac);
	ac = 0;
	if (text_wmo)
		XtAddCallback( text_wmo, XmNactivateCallback, text_activate_callback, (XtPointer) 0 );
	children[ac++] = text_wmo;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = search_option;
	children[ac++] = row_pos;
	children[ac++] = row_area;
	children[ac++] = row_name;
	children[ac++] = row_ident;
	children[ac++] = row_wmo;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = drag;
	XtManageChildren(children, ac);
	ac = 0;
	XmScrolledWindowSetAreas(scrolledWin1, scrollbar1, scrollbar2, drag );
	if (list_stbase)
		XtAddCallback( list_stbase, XmNbrowseSelectionCallback, list_browse_callback, (XtPointer) 0 );
	XtManageChild(list_stbase);
	children[ac++] = scrolledWin1;
	XtManageChildren(children, ac);
	ac = 0;
	if (button6)
		XtAddCallback( button6, XmNactivateCallback, quit_callback, (XtPointer) 0 );
	if (button7)
		XtAddCallback( button7, XmNactivateCallback, quit_callback, (XtPointer) 0 );
	children[ac++] = button7;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu1); ac++;
	XtSetValues(cascade2, al, ac );
	ac = 0;
	if (plot_sel_button)
		XtAddCallback( plot_sel_button, XmNactivateCallback, plot_sel_callback, (XtPointer) 0 );
	if (plot_all_button)
		XtAddCallback( plot_all_button, XmNactivateCallback, plot_all_callback, (XtPointer) 0 );
	if (toggle1)
		XtAddCallback( toggle1, XmNvalueChangedCallback, clear_callback, (XtPointer) 0 );
	if (toggle2)
		XtAddCallback( toggle2, XmNvalueChangedCallback, names_callback, (XtPointer) 0 );
	children[ac++] = plot_sel_button;
	children[ac++] = plot_all_button;
	children[ac++] = separator2;
	children[ac++] = toggle1;
	children[ac++] = toggle2;
	XtManageChildren(children, ac);
	ac = 0;
	XtSetArg(al[ac], XmNsubMenuId, menu2); ac++;
	XtSetValues(cascade3, al, ac );
	ac = 0;
	if (helpw)
		XtAddCallback( helpw, XmNactivateCallback, help_callback, (XtPointer) 0 );
	children[ac++] = cascade2;
	children[ac++] = cascade3;
	children[ac++] = helpw;
	XtManageChildren(children, ac);
	ac = 0;
	children[ac++] = label_info;
	children[ac++] = sub_form;
	children[ac++] = panedWindow1;
	children[ac++] = button6;
	children[ac++] = separator1;
	children[ac++] = menuBar1;
	XtManageChildren(children, ac);
	ac = 0;
	XtManageChild ( form);
}

