X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=xio.c;h=ea13d0554cc1f044dee0267736149648972a10c6;hp=494ea7a41a8286df77e63601a9a89fc67c1d7d9c;hb=29ad72468c182d54cca779529a2ea5ab288ef8ba;hpb=26dfc5effef436ff09e7df80b26b34e20cc86165 diff --git a/xio.c b/xio.c index 494ea7a..ea13d05 100644 --- a/xio.c +++ b/xio.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -9,27 +10,31 @@ XtAppContext app_context; Widget toplevel, form, quit, text; void quit_proc (Widget w, XtPointer client_data, XtPointer call_data) -{ XtDestroyApplicationContext (app_context); - exit (0); +{ + XtDestroyApplicationContext (app_context); + exit (0); } int main (int argc, char **argv) -{ toplevel = XtVaOpenApplication (&app_context, "XThird", NULL, 0, &argc, - argv, NULL, applicationShellWidgetClass, - XtNallowShellResize, True, NULL); - form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL); - quit = XtVaCreateManagedWidget ("quit", commandWidgetClass, form, XtNlabel, - "Quit", NULL); - text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form, - XtNfromHoriz, quit, XtNresize, - XawtextResizeBoth, XtNresizable, True, NULL); - XtAddCallback (quit, XtNcallback, quit_proc, NULL); - if (argc <= 1) - XtVaSetValues (text, XtNtype, XawAsciiString, XtNstring, "Fool! You should" - " supply a file name!", NULL); - else - XtVaSetValues (text, XtNtype, XawAsciiFile, XtNstring, argv [1], NULL); - XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL); - XtRealizeWidget (toplevel); - XtAppMainLoop (app_context); +{ + toplevel = XtVaOpenApplication (&app_context, "XThird", NULL, 0, &argc, + argv, NULL, applicationShellWidgetClass, + XtNallowShellResize, True, NULL); + form = XtVaCreateManagedWidget ("form", formWidgetClass, toplevel, NULL); + quit = XtVaCreateManagedWidget ("quit", commandWidgetClass, form, XtNlabel, + "Quit", NULL); + text = XtVaCreateManagedWidget ("text", asciiTextWidgetClass, form, + XtNfromVert, quit, XtNresize, + XawtextResizeBoth, XtNresizable, True, NULL); + XtAddCallback (quit, XtNcallback, quit_proc, NULL); + if (argc <= 1) + XtVaSetValues (text, XtNtype, XawAsciiString, + XtNstring, "Fool! You should" + " supply a file name!", NULL); + else + XtVaSetValues (text, XtNtype, XawAsciiFile, XtNstring, argv [1], NULL); + XtVaSetValues (text, XtNeditType, XawtextRead, XtNdisplayCaret, False, NULL); + XtRealizeWidget (toplevel); + XtAppMainLoop (app_context); + exit(0); }