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, buttons, quit, destruct, text;
13 "*destruct.fromHoriz: quit",
17 static void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
19 XtDestroyApplicationContext (app_context);
23 int main (int argc, char **argv)
25 toplevel = XtVaOpenApplication (&app_context, "XThird", NULL, 0, &argc,
27 applicationShellWidgetClass,
28 XtNallowShellResize, True, NULL);
29 form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
30 /* The button panel */
31 buttons = XtVaCreateManagedWidget ("form", formWidgetClass, form, NULL);
32 quit = XtVaCreateManagedWidget("quit",
33 commandWidgetClass, buttons,
34 XtNlabel, "Quit", NULL);
35 XtAddCallback (quit, XtNcallback, quit_proc, NULL);
36 destruct = XtVaCreateManagedWidget("destruct",
37 commandWidgetClass, buttons,
38 XtNlabel, "Destruct", NULL);
39 /* the command window */
40 text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
42 XtNresize, XawtextResizeBoth,
43 XtNresizable, True, NULL);
45 /* sample text so the widget will be identifiable */
46 XtVaSetValues (text, XtNtype, XawAsciiString,
47 XtNstring, "Command window", NULL);
48 XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
49 XtRealizeWidget (toplevel);
50 XtAppMainLoop (app_context);
51 /* loop may be interrupted */
52 XtDestroyApplicationContext (app_context);