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
|
// gcc option_menu.c -lXt -lXm
#include <Xm/Xm.h>
#include <Xm/Form.h>
#include <Xm/PushB.h>
Boolean ViewerCheck()
{
usleep(100000);
return False;
}
int main()
{
Widget TopLevel,form,wdg1,wdg2,wdg3,wdg4;
XtAppContext app;
int argc=0;
char *argv[1];
XtSetLanguageProc(NULL,NULL,NULL);
TopLevel = XtVaAppInitialize(&app,"Test",NULL,0,&argc,argv,NULL,NULL);
form = XtVaCreateManagedWidget( "Test",
xmFormWidgetClass, TopLevel,
XmNwidth, 100,
XmNheight, 60);
wdg1 = XmCreatePulldownMenu(form, "pulldown", NULL, 0);
wdg2 = XtVaCreateManagedWidget("1", xmPushButtonWidgetClass, wdg1,
XmNwidth, 60);
wdg3 = XtVaCreateManagedWidget("2", xmPushButtonWidgetClass, wdg1,
XmNwidth, 60);
wdg4 = XmCreateOptionMenu(form, "TEST", NULL, 0);
XtVaSetValues(wdg4, XmNsubMenuId, wdg1);
XtManageChild(wdg4);
XtRealizeWidget(TopLevel);
XtAppAddWorkProc(app, (XtWorkProc) ViewerCheck, (XtPointer) NULL);
XtAppMainLoop(app);
return 0;
}
|