1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 #include <Xm/Xm.h>
51 #include <Xm/Label.h>
52 #include <XmL/Folder.h>
53
54 main(argc, argv)
55 int argc;
56 char *argv[];
57 {
58 XtAppContext app;
59 Widget shell, folder, form;
60 XmString str;
61 char buf[
20];
62 int i;
63
64 shell = XtAppInitialize(&app,
"Folder1",
NULL,
0,
65 &argc, argv,
NULL,
NULL,
0);
66
67 folder = XtVaCreateManagedWidget(
"folder",
68 xmlFolderWidgetClass, shell,
69 NULL);
70
71 for (i =
0; i <
3; i++)
72 {
73
74 sprintf(buf,
"Tab %d", i);
75 str = XmStringCreateSimple(buf);
76 form = XmLFolderAddTabForm(folder, str);
77 XmStringFree(str);
78
79
80 sprintf(buf,
"Form %d", i);
81 XtVaCreateManagedWidget(buf,
82 xmLabelWidgetClass, form,
83 XmNmarginWidth,
100,
84 XmNmarginHeight,
80,
85 XmNtopAttachment, XmATTACH_FORM,
86 XmNbottomAttachment, XmATTACH_FORM,
87 XmNleftAttachment, XmATTACH_FORM,
88 XmNrightAttachment, XmATTACH_FORM,
89 NULL);
90 }
91
92 XtRealizeWidget(shell);
93 XtAppMainLoop(app);
94 }
95