/* xbutton.c - a very simple X Toolkit application, Jeff Pitchers, LUT 1993 */
/* Athena Toolkit version */
/* Include the necessary Athena Toolkit header files */
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Command.h>
main(argc, argv)
int argc; char **argv;
{
XtAppContext ac;
Widget top, button;
int Stop();
top = XtVaAppInitialize(&ac, "XButton", NULL, 0, &argc, argv, NULL, NULL);
button = XtVaCreateManagedWidget("quit", commandWidgetClass, top, NULL);
XtAddCallback(button, XtNcallback, Stop, NULL);
XtRealizeWidget(top);
XtAppMainLoop(ac);
}
/* Callback routine when button is clicked */
/* ARGSUSED */
Stop(w, a, b)
Widget w; XtPointer a, b;
{
exit(0);
}
Figure 19: The Athena version of xbutton