PushButton's XmN-activateCallback resource is called, the reason is XmCR_ACTIVATE. The different
values for reason make it easier to write callback routines that are called by more than one type of widget. By
testing the reason field, you can determine the appropriate action to take in the callback. Because the widget is
always passed to the callback function, you can also find out what widget caused the function to be invoked.
The event field contains the actual event that triggered the callback, which can provide a great deal of useful
information. See Volume Four, X Toolkit Intrinsics Programming Manual, for information on how to interpret the
contents of an event. That subject is not discussed at length in this book, although our examples frequently use the
events in callback structures to control processing.
3.3.7 The Event Loop
Once all of the widgets for an application have been created and managed and all of the callbacks have been
registered, it's time to start the application running. The final two function calls in hello.c perform this task:
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
Realizing a widget creates the actual window for the widget. When you call XtRealizeWidget() on the top−level
widget of an application (the one returned by the call to XtVaAppInitialize()), Xt recursively traverses the
hierarchy of widgets in the application and creates a window for each widget. Before this point, the widgets existed
only as data structures on the client side of the X connection. ...