1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/form/test60.c,v 1.1 2002/06/15 16:31:07 dannybackx Exp $ */
2 
3 #include <stdlib.h>
4 #include <stdio.h>
5 
6 #include <Xm/PushB.h>
7 #include <Xm/Form.h>
8 #include <Xm/Label.h>
9 #include <Xm/List.h>
10 #include <Xm/MainW.h>
11 #include <Xm/TextF.h>
12 
13 #include "../../common/Test.h"
14 
15 
16 XtAppContext appcontext;
17 Widget toplevel, form;
18 
main(int argc,char * argv[])19 int main(int argc, char *argv[])
20 {
21 	Widget	a, b;
22 
23 	XtSetLanguageProc(NULL, NULL, NULL);
24 	toplevel = XtVaAppInitialize(&appcontext, "Test", NULL, 0, &argc, argv,
25 				     NULL, NULL);
26 
27 /* Create main window */
28 	form = XtVaCreateManagedWidget("form", xmFormWidgetClass, toplevel,
29 		XmNfractionBase,	7,
30 		XmNwidth,		350,
31 		XmNheight,		100,
32 		NULL);
33 
34 	a = XtVaCreateManagedWidget("label a", xmPushButtonWidgetClass, form,
35 		XmNx,			50,
36 		XmNwidth,		100,
37 		XmNtopAttachment,	XmATTACH_POSITION,
38 		XmNtopPosition,		1,
39 		XmNleftAttachment,	XmATTACH_SELF,
40 		XmNrightAttachment,	XmATTACH_SELF,
41 		XmNbottomAttachment,	XmATTACH_POSITION,
42 		XmNbottomPosition,	5,
43 		NULL);
44 
45 	b = XtVaCreateManagedWidget("label b", xmPushButtonWidgetClass, form,
46 		XmNx,			200,
47 		XmNwidth,		100,
48 		XmNtopAttachment,	XmATTACH_POSITION,
49 		XmNtopPosition,		1,
50 		XmNleftAttachment,	XmATTACH_SELF,
51 		XmNrightAttachment,	XmATTACH_SELF,
52 		XmNbottomAttachment,	XmATTACH_POSITION,
53 		XmNbottomPosition,	5,
54 		NULL);
55 	XtManageChild(form);
56 
57 	XtRealizeWidget(toplevel);
58 
59     {
60 /* Note: the following values are the result of
61  * querying the current geometry.
62  */
63 static XtWidgetGeometry Expected[] = {
64    {CWWidth | CWHeight            ,    0,    0,  350,  100, 0,0,0, /* mainwindow */},
65    {CWWidth | CWHeight | CWX | CWY,   50,   14,  100,   57, 0,0,0, /* menubar */},
66    {CWWidth | CWHeight | CWX | CWY,  200,   14,  100,   57, 0,0,0, /* button_0 */},
67 };
68 
69 	PrintDetails(toplevel, Expected);
70     }
71 
72 	/*
73 	XtAppMainLoop(appcontext);
74 	*/
75 	LessTifTestMainLoop(toplevel);
76 
77 	return(0);
78 }
79