2 #include <X11/Intrinsic.h>
3 #include <X11/StringDefs.h>
5 #include <X11/Xaw/Form.h>
6 #include <X11/Xaw/Command.h>
7 #include <X11/Xaw/AsciiText.h>
9 XtAppContext app_context;
10 Widget toplevel, form, text;
11 Widget buttons, phasers, photons, destruct, quit;
15 "*phasers.label: Phasers",
16 "*photons.label: Torps",
17 "*destruct.label: Destruct",
19 /* text window resources */
20 "*text.resizable: true",
21 "*text.resize: ResizeBoth",
22 /* layout constraints */
23 "*photons.fromHoriz: phasers",
24 "*destruct.fromHoriz: photons",
25 "*quit.fromHoriz: destruct",
29 static void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
31 XtDestroyApplicationContext (app_context);
35 int main (int argc, char **argv)
37 toplevel = XtVaOpenApplication (&app_context, "sst2k", NULL, 0, &argc,
39 applicationShellWidgetClass,
40 XtNallowShellResize, True, NULL);
41 form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
42 /* The button panel */
43 buttons = XtVaCreateManagedWidget ("form", formWidgetClass, form, NULL);
44 phasers = XtVaCreateManagedWidget("phasers",
45 commandWidgetClass, buttons,
47 photons = XtVaCreateManagedWidget("photons",
48 commandWidgetClass, buttons,
50 destruct = XtVaCreateManagedWidget("destruct",
51 commandWidgetClass, buttons,
53 quit = XtVaCreateManagedWidget("quit",
54 commandWidgetClass, buttons,
56 XtAddCallback (quit, XtNcallback, quit_proc, NULL);
57 /* the command window */
58 text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
62 /* sample text so the widget will be identifiable */
63 XtVaSetValues (text, XtNtype, XawAsciiString,
64 XtNstring, "Command window", NULL);
65 XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
66 XtRealizeWidget (toplevel);
67 XtAppMainLoop (app_context);
68 /* loop may be interrupted */
69 XtDestroyApplicationContext (app_context);