-
Notifications
You must be signed in to change notification settings - Fork 0
/
testctrl.c
77 lines (60 loc) · 1.38 KB
/
testctrl.c
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**** testctrl.c ****/ /**** formatted with 4-column tabs ****/
#include "ctrlpanel.h"
/*
Functions:
*/
static void Quit(), Print();
/*
Private data:
*/
static Widget topLevel;
static CtrlPanel panel;
/*
main() creates a top-level window with a control panel.
*/
void main(argc, argv)
int argc;
char *argv[];
{
static CtrlPanelItem items[] = {
{"Quit", "quitButton", Quit, NULL},
{"", NULL, NULL, NULL},
{"Print", "printButton", Print, NULL},
NULL,
};
XtAppContext app;
topLevel = XtAppInitialize(&app, "TestCtrl",
(XrmOptionDescList) NULL, 0,
&argc, argv, (String *) NULL, (ArgList) NULL, 0);
/* panel = ctrlPanel_create(topLevel, "panel", items,
XmSTRING_DEFAULT_CHARSET, ctrlPanel_HORIZONTAL);*/
panel = ctrlPanel_create(topLevel, NULL, items,
XmSTRING_DEFAULT_CHARSET, ctrlPanel_VERTICAL);
XtRealizeWidget(topLevel);
XtAppMainLoop(app);
} /* main */
/*
Quit() terminates the application.
*/
/*ARGSUSED*/
static void Quit(w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
printf("Your pressed the \"Quit\" button.\n");
printf("This program is being terminated.\n");
ctrlPanel_destroy(panel);
exit(0);
} /* Quit */
/*
Print() prints a simple message.
*/
/*ARGSUSED*/
static void Print(w, client_data, call_data)
Widget w;
XtPointer client_data;
XtPointer call_data;
{
printf("Your pressed the \"Print\" button.\n");
} /* Print */