1 #include <X11/Intrinsic.h>
2 #include <X11/StringDefs.h>
4 #include <X11/Xaw/Form.h>
5 #include <X11/Xaw/Command.h>
6 #include <X11/Xaw/AsciiText.h>
8 XtAppContext app_context;
9 Widget toplevel, form, quit, text;
11 void quit_proc (Widget w, XtPointer client_data, XtPointer call_data)
12 { XtDestroyApplicationContext (app_context);
16 int main (int argc, char **argv)
17 { toplevel = XtVaOpenApplication (&app_context, "XThird", NULL, 0, &argc,
18 argv, NULL, applicationShellWidgetClass,
19 XtNallowShellResize, True, NULL);
20 form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL);
21 quit = XtVaCreateManagedWidget ("quit", commandWidgetClass, form, XtNlabel,
23 text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form,
24 XtNfromHoriz, quit, XtNresize,
25 XawtextResizeBoth, XtNresizable, True, NULL);
26 XtAddCallback (quit, XtNcallback, quit_proc, NULL);
28 XtVaSetValues (text, XtNtype, XawAsciiString, XtNstring, "Fool! You should"
29 " supply a file name!", NULL);
31 XtVaSetValues (text, XtNtype, XawAsciiFile, XtNstring, argv [1], NULL);
32 XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL);
33 XtRealizeWidget (toplevel);
34 XtAppMainLoop (app_context);