1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/rowcolumn/test42.c,v 1.3 2001/05/15 14:46:10 amai Exp $ */
2 #include <stdlib.h>
3 #include <stdio.h>
4 
5 #include <Xm/Xm.h>
6 #include <Xm/PushB.h>
7 #include <Xm/RowColumn.h>
8 #include <Xm/Frame.h>
9 #include <Xm/Label.h>
10 #include <Xm/TextF.h>
11 #include <Xm/Separator.h>
12 
13 #include "../../common/Test.h"
14 
15 static char *FallBack[] = {
16 		"*.geometrySlop: 0",
17 		NULL
18 };
19 
20 int
main(int argc,char ** argv)21 main(int argc, char **argv)
22 {
23   XtAppContext	app;
24   Widget Shell;
25   Widget Form;
26   Widget BottomLabel;
27   Widget TopLabel;
28   Widget Sep;
29 
30   XtSetLanguageProc(NULL, NULL, NULL);
31 
32   Shell = XtVaAppInitialize(&app, "Shell", NULL, 0, &argc, argv, FallBack, NULL);
33 
34   Form = XmCreateRowColumn(Shell,"RC",NULL,0);
35   XtVaSetValues(Form,
36   	NULL);
37 
38   BottomLabel = XmCreateLabel(Form,"TopLabel",NULL,0);
39   XtVaSetValues(BottomLabel,
40   	XmNalignment, XmALIGNMENT_CENTER,
41   	XmNwidth, 52,
42   	XmNheight, 17,
43   	XmNrecomputeSize, False,
44   	NULL);
45   XtManageChild(BottomLabel);
46 
47   Sep = XmCreateSeparator(Form, "Sep", NULL, 0);
48   XtManageChild(Sep);
49 
50   BottomLabel = XmCreateLabel(Form,"BottomLabel",NULL,0);
51   XtVaSetValues(BottomLabel,
52   	XmNalignment, XmALIGNMENT_CENTER,
53   	XmNwidth, 70,
54   	XmNheight, 30,
55   	XmNrecomputeSize, False,
56   	NULL);
57   XtManageChild(BottomLabel);
58 
59   XtManageChild(Form);
60 
61   XtRealizeWidget(Shell);
62 
63 /* Note: the following values are the result of
64  * querying the current geometry.
65  */
66 {
67 XtWidgetGeometry Expected[] = {
68    CWWidth | CWHeight            ,  673,  241,   76,   61, 0,0,0, /* RC */
69    CWWidth | CWHeight | CWX | CWY,    3,    3,   70,   17, 0,0,0, /* TopLabel */
70    CWWidth | CWHeight | CWX | CWY,    3,   23,   70,    2, 0,0,0, /* Sep */
71    CWWidth | CWHeight | CWX | CWY,    3,   28,   70,   30, 0,0,0, /* BottomLabel */
72 
73    CWWidth | CWHeight            ,  673,  241,  144,   61, 0,0,0, /* RC */
74    CWWidth | CWHeight | CWX | CWY,    3,    3,  138,   17, 0,0,0, /* TopLabel */
75    CWWidth | CWHeight | CWX | CWY,    3,   23,  138,    2, 0,0,0, /* Sep */
76    CWWidth | CWHeight | CWX | CWY,    3,   28,  138,   30, 0,0,0, /* BottomLabel */
77 
78    CWWidth | CWHeight            ,  673,  241,   80,   61, 0,0,0, /* RC */
79    CWWidth | CWHeight | CWX | CWY,    3,    3,   74,   17, 0,0,0, /* TopLabel */
80    CWWidth | CWHeight | CWX | CWY,    3,   23,   74,    2, 0,0,0, /* Sep */
81    CWWidth | CWHeight | CWX | CWY,    3,   28,   74,   30, 0,0,0, /* BottomLabel */
82 };
83 
84   PrintDetails(Shell, Expected);
85   LessTifTestWaitForIt(Shell);
86   LessTifTestResizeWidget(Shell, 144, 61);
87   PrintDetails(Shell, Expected);
88   LessTifTestWaitForIt(Shell);
89   LessTifTestResizeWidget(Shell, 80, 61);
90   PrintDetails(Shell, Expected);
91 }
92 
93       LessTifTestMainLoop(Shell);
94   exit(0);
95 }
96