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 /* layout constraints */
20 "*photons.fromHoriz: phasers",
21 "*destruct.fromHoriz: photons",
22 "*quit.fromHoriz: destruct",
26 static void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
28 XtDestroyApplicationContext (app_context);
32 int main (int argc, char **argv)
34 toplevel = XtVaOpenApplication (&app_context, "sst2k", NULL, 0, &argc,
36 applicationShellWidgetClass,
37 XtNallowShellResize, True, NULL);
38 form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
39 /* The button panel */
40 buttons = XtVaCreateManagedWidget ("form", formWidgetClass, form, NULL);
41 phasers = XtVaCreateManagedWidget("phasers",
42 commandWidgetClass, buttons,
44 photons = XtVaCreateManagedWidget("photons",
45 commandWidgetClass, buttons,
47 destruct = XtVaCreateManagedWidget("destruct",
48 commandWidgetClass, buttons,
50 quit = XtVaCreateManagedWidget("quit",
51 commandWidgetClass, buttons,
53 XtAddCallback (quit, XtNcallback, quit_proc, NULL);
54 /* the command window */
55 text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
57 XtNresize, XawtextResizeBoth,
58 XtNresizable, True, NULL);
60 /* sample text so the widget will be identifiable */
61 XtVaSetValues (text, XtNtype, XawAsciiString,
62 XtNstring, "Command window", NULL);
63 XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
64 XtRealizeWidget (toplevel);
65 XtAppMainLoop (app_context);
66 /* loop may be interrupted */
67 XtDestroyApplicationContext (app_context);