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;
12 void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
14 XtDestroyApplicationContext (app_context);
18 int main (int argc, char **argv)
20 toplevel = XtVaOpenApplication (&app_context, "XThird", NULL, 0, &argc,
21 argv, NULL, applicationShellWidgetClass,
22 XtNallowShellResize, True, NULL);
23 form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
24 buttons = XtVaCreateManagedWidget ("form", formWidgetClass, form, NULL);
25 quit = XtVaCreateManagedWidget("quit",
26 commandWidgetClass, buttons,
27 XtNlabel, "Quit", NULL);
28 destruct = XtVaCreateManagedWidget("destruct",
29 commandWidgetClass, buttons,
31 XtNlabel, "Destruct", NULL);
32 text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
33 XtNfromVert, buttons, XtNresize,
34 XawtextResizeBoth, XtNresizable, True, NULL);
35 XtAddCallback (quit, XtNcallback, quit_proc, NULL);
37 /* sample text so the widget will be identifiable */
38 XtVaSetValues (text, XtNtype, XawAsciiString,
39 XtNstring, "Command window", NULL);
40 XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
41 XtRealizeWidget (toplevel);
42 XtAppMainLoop (app_context);