1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/frame/test2.c,v 1.7 2002/01/12 15:02:45 amai Exp $ */
2
3 #include <stdlib.h>
4 #include <stdio.h>
5
6 #include <Xm/Xm.h>
7 #ifdef LESSTIF_VERSION
8 #include <XmI/MacrosI.h>
9 #endif
10 #include <Xm/FrameP.h>
11 #include <Xm/Label.h>
12 #include <Xm/LabelG.h>
13 #include <Xm/PushB.h>
14 #include <Xm/TextF.h>
15 #include <Xm/RowColumn.h>
16
17 int
main(int argc,char ** argv)18 main(int argc, char **argv)
19 {
20 Widget toplevel, one, two, three, four, five;
21 XtAppContext app;
22
23 XtSetLanguageProc(NULL, NULL, NULL);
24
25 toplevel = XtVaAppInitialize(&app, "Frame", NULL, 0, &argc, argv, NULL, NULL);
26
27 one = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, toplevel,
28 NULL);
29
30 two = XtVaCreateManagedWidget("OuterLabel", xmLabelWidgetClass, one,
31 XmNchildType, XmFRAME_TITLE_CHILD,
32 XmNchildVerticalAlignment, XmALIGNMENT_CENTER,
33 XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING,
34 NULL);
35
36 four = XtVaCreateManagedWidget("frame", xmFrameWidgetClass, one,
37 XmNshadowType, XmSHADOW_IN,
38 XmNchildType, XmFRAME_WORKAREA_CHILD,
39 NULL);
40
41 three = XtVaCreateManagedWidget("three", xmTextFieldWidgetClass, four,
42 XmNchildType, XmFRAME_WORKAREA_CHILD,
43 NULL);
44
45 five = XtVaCreateManagedWidget("InnerLabel", xmLabelWidgetClass, four,
46 XmNchildType, XmFRAME_TITLE_CHILD,
47 XmNchildVerticalAlignment, XmALIGNMENT_CENTER,
48 XmNchildHorizontalAlignment, XmALIGNMENT_BEGINNING,
49 NULL);
50
51 XtRealizeWidget(toplevel);
52 #ifdef LESSTIF_VERSION
53 printf("(IGNORE_IN_DIFF) PC: %d\n", Frame_ProcessingConstraints(one));
54 #endif
55 {
56 static XtWidgetGeometry Expected[] = {
57 CWWidth | CWHeight , 506, 322, 144, 68, 0,0,0, /* frame */
58 CWWidth | CWHeight | CWX | CWY, 11, 0, 64, 17, 0,0,0, /* OuterLabel */
59 CWWidth | CWHeight | CWX | CWY, 1, 17, 142, 50, 0,0,0, /* frame */
60 CWWidth | CWHeight | CWX | CWY, 2, 17, 138, 31, 0,0,0, /* three */
61 CWWidth | CWHeight | CWX | CWY, 12, 0, 64, 17, 0,0,0, /* InnerLabel */
62 };
63 /* toplevel should be replaced with to correct applicationShell */
64 PrintDetails(toplevel, Expected);
65 }
66 LessTifTestMainLoop(toplevel);
67
68 exit(0);
69 }
70