1 #include <Xm/XmP.h>
2 #include <Xm/ScrolledWP.h>
3 #include <Xm/RowColumnP.h>
4 #include <Xm/DrawingA.h>
5 #ifdef LESSTIF_VERSION
6 #include <XmI/XmI.h>
7 #endif
8
9 int
main(int argc,char ** argv)10 main(int argc, char **argv)
11 {
12 Widget toplevel;
13 Widget sw, da, rc;
14
15 XtAppContext app;
16
17 XtSetLanguageProc(NULL, NULL, NULL);
18
19 toplevel = XtVaAppInitialize(&app, "Label", NULL, 0, &argc, argv, NULL, NULL);
20
21 rc = XtVaCreateManagedWidget("rc",xmRowColumnWidgetClass,
22 toplevel,
23 NULL);
24
25 /* create a 'VARIABLE' scrolledwin */
26 sw = XtVaCreateManagedWidget("sw",
27 xmScrolledWindowWidgetClass,
28 rc,
29 XmNscrollingPolicy, XmAPPLICATION_DEFINED,
30 XmNvisualPolicy, XmVARIABLE,
31 XmNwidth,200,
32 XmNheight,100,
33 NULL);
34
35 /* the child is smaller, but at creation time their
36 * `variable' scrolledw doesn't shrink.
37 */
38 da = XtVaCreateManagedWidget("da",
39 xmDrawingAreaWidgetClass,
40 sw,
41 XmNwidth,100,
42 XmNheight,100,
43 NULL);
44
45 XmScrolledWindowSetAreas(sw, NULL, NULL, da);
46
47 /* create another 'VARIABLE' scrolledwin */
48 sw = XtVaCreateManagedWidget("sw",
49 xmScrolledWindowWidgetClass,
50 rc,
51 XmNscrollingPolicy, XmAPPLICATION_DEFINED,
52 XmNvisualPolicy, XmVARIABLE,
53 XmNwidth,200,
54 XmNheight,100,
55 NULL);
56
57 /* this time, the child is bigger, but at creation time their
58 * `variable' scrolledw doesn't grow.
59 */
60 da = XtVaCreateManagedWidget("da",
61 xmDrawingAreaWidgetClass,
62 sw,
63 XmNwidth,300,
64 XmNheight,300,
65 NULL);
66
67 XmScrolledWindowSetAreas(sw, NULL, NULL, da);
68
69 XtRealizeWidget(toplevel);
70
71 {
72 static XtWidgetGeometry Expected[] = {
73 CWWidth | CWHeight , 4, 50, 206, 209, 0,0,0, /* rc */
74 CWWidth | CWHeight | CWX | CWY, 3, 3, 200, 100, 0,0,0, /* sw */
75 CWWidth | CWHeight | CWX | CWY, 0, 0, 200, 100, 0,0,0, /* da */
76 CWWidth | CWHeight | CWX | CWY, 3, 106, 200, 100, 0,0,0, /* sw */
77 CWWidth | CWHeight | CWX | CWY, 0, 0, 200, 100, 0,0,0, /* da */
78 };
79 PrintDetails(toplevel,Expected);
80 };
81 LessTifTestMainLoop(toplevel);
82
83 exit(0);
84 }
85