1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/form/test23.c,v 1.5 2001/05/16 09:23:15 amai Exp $ */
2
3 #include <stdlib.h>
4 #include <stdio.h>
5
6 #include <Xm/Xm.h>
7 #include <Xm/Label.h>
8 #include <Xm/TextF.h>
9 #include <Xm/Form.h>
10
11 #include "../../common/Test.h"
12
13
14
15 static String FallBack[] = {
16 "*borderWidth: 1",
17 NULL};
18
19 int
main(int argc,char ** argv)20 main(int argc, char **argv)
21 {
22 Widget toplevel;
23 Widget Form;
24 Widget LeftLabel;
25 Widget RightLabel;
26 XtAppContext app;
27
28 XtSetLanguageProc(NULL, NULL, NULL);
29
30 toplevel = XtVaAppInitialize(&app, "test23", NULL, 0, &argc, argv, FallBack, NULL);
31
32 Form = XmCreateForm(toplevel, "Form", NULL, 0);
33 XtVaSetValues(Form,
34 XmNresizePolicy, XmRESIZE_GROW,
35 #if 0
36 XmNwidth, 200,
37 #else
38 XmNheight, 200,
39 #endif
40 NULL);
41
42 RightLabel = XmCreateLabel(Form, "RightLabel", NULL,0);
43 LeftLabel = XmCreateLabel(Form, "LeftLabel", NULL,0);
44
45 #if 0
46 XtVaSetValues(RightLabel,
47 XmNtopAttachment, XmATTACH_FORM,
48 XmNleftAttachment, XmATTACH_WIDGET,
49 XmNleftOffset, 10,
50 XmNleftWidget, LeftLabel,
51 XmNwidth, 90,
52 XmNrightAttachment, XmATTACH_FORM,
53 XmNrightOffset, 10,
54 NULL);
55 XtManageChild(RightLabel);
56
57 XtVaSetValues(LeftLabel,
58 XmNleftAttachment, XmATTACH_FORM,
59 XmNtopAttachment, XmATTACH_FORM,
60 XmNleftOffset, 50,
61 XmNwidth, 100,
62 NULL);
63 XtManageChild(LeftLabel);
64 #else
65 XtVaSetValues(RightLabel,
66 XmNleftAttachment, XmATTACH_FORM,
67 XmNtopAttachment, XmATTACH_WIDGET,
68 XmNtopOffset, 10,
69 XmNtopWidget, LeftLabel,
70 XmNheight, 90,
71 XmNbottomAttachment, XmATTACH_FORM,
72 XmNbottomOffset, 10,
73 NULL);
74 XtManageChild(RightLabel);
75
76 XtVaSetValues(LeftLabel,
77 XmNtopAttachment, XmATTACH_FORM,
78 XmNleftAttachment, XmATTACH_FORM,
79 XmNtopOffset, 50,
80 XmNheight, 100,
81 NULL);
82 XtManageChild(LeftLabel);
83 #endif
84
85 XtManageChild(Form);
86
87 XtRealizeWidget(toplevel);
88
89 {
90 static XtWidgetGeometry Expected[] = {
91 CWWidth | CWHeight, 0, 0, 66, 200, 0,0,0, /* Form */
92 CWWidth | CWHeight | CWX | CWY, 0, 162, 64, 26, 0,0,0, /* two */
93 CWWidth | CWHeight | CWX | CWY, 0, 50, 58, 100, 0,0,0, /* two */
94 };
95
96 PrintDetails(toplevel, Expected);
97 }
98 LessTifTestMainLoop(toplevel);
99
100 exit(0);
101 }
102