1 /*
2 $Header: /cvsroot/lesstif/lesstif/test/Xm/mainw/test9.c,v 1.5 2002/05/03 12:03:41 amai Exp $
3 ============
4 !Resource file: Test-prog
5 *XmMainWindow.width: 850
6 *XmMainWindow.height: 330
7 ============
8 */
9
10 #include <stdlib.h>
11
12 #include <Xm/Xm.h>
13 #include <Xm/MainW.h>
14 #include <Xm/RepType.h>
15 #include <Xm/RowColumn.h>
16 #include <Xm/Frame.h>
17 #include <Xm/RowColumn.h>
18 #include <Xm/Label.h>
19
20 #include "../../common/Test.h"
21
22 static Widget top;
23 static XtAppContext app_context;
24 static Widget main_window;
25 static Widget menubar;
26
27
28 int
main(int argc,char * argv[])29 main(int argc, char *argv[]) {
30 Widget rc, frame1, label;
31
32 XtSetLanguageProc(NULL, NULL, NULL);
33
34 top = XtVaAppInitialize(&app_context,
35 "Test-prog",
36 NULL, 0,
37 &argc, argv,
38 NULL,
39 NULL);
40
41 main_window =
42 XtVaCreateManagedWidget("mainwin", xmMainWindowWidgetClass, top, NULL);
43
44 XmRepTypeInstallTearOffModelConverter();
45
46 menubar = XmCreateMenuBar(main_window, "menubar", NULL, 0);
47 XtManageChild(menubar);
48
49 XmMainWindowSetAreas(main_window,menubar,NULL,NULL,NULL,NULL);
50
51 rc = XtVaCreateWidget("rc", xmRowColumnWidgetClass, main_window, NULL);
52
53 XtVaSetValues(main_window, XmNworkWindow, rc, NULL);
54 XtManageChild(rc);
55
56 frame1 = XtVaCreateWidget("frame1",
57 xmFrameWidgetClass,
58 rc,
59 NULL);
60 XtManageChild(frame1);
61
62 XtRealizeWidget(top);
63
64 label = XtVaCreateManagedWidget("Rampaging Bulldozers",
65 xmLabelWidgetClass,
66 frame1,
67 NULL);
68
69 {
70 static XtWidgetGeometry Expected[] = {
71 CWWidth | CWHeight , 56, 72, 16, 32, 0,0,0, /* mainwin */
72 CWWidth | CWHeight | CWX | CWY, 0, 0, 16, 16, 0,0,0, /* menubar */
73 CWWidth | CWHeight | CWX | CWY, 0, 16, 16, 16, 0,0,0, /* rc */
74 CWWidth | CWHeight | CWX | CWY, 3, 3, 10, 4, 0,0,0, /* frame1 */
75 CWWidth | CWHeight | CWX | CWY, 2, 2, 6, 1, 0,0,0, /* Rampaging Bulldozers */
76 };
77 /* toplevel should be replaced with to correct applicationShell */
78 PrintDetails(top, Expected);
79 }
80 LessTifTestMainLoop(top);
81
82 exit(0);
83 }
84