Output of hello_dialog.c
Dialogs are often invoked from callback routines attached to PushButtons or other interactive widgets. Once the
dialog is created and popped up, control of the program is returned to the main event−handling loop
(XtAppMainLoop()), where normal event processing resumes. At this point, if the user interacts with the dialog by
selecting a control or activating one of the action buttons, a callback routine for the dialog is invoked. In the source
code we happen to use an InformationDialog, but the type of dialog used is irrelevant to the model.
When the PushButton in the main window is pressed, popup() is called. A text string that is used as the message to
display in the InformationDialog is passed as client data. The dialog uses a single callback routine, activate(), for
the XmNokCallback resource. This function is invoked when the user presses the OK button. The callback simply
prints a message to standard output that the button has been pressed. Similar callback routines could be installed for
the Cancel and Help buttons through the XmNcancelCallback and -XmNhelpCallback resources.
6.3.5 Closing Dialogs
You might notice that activating either the OK or the Cancel button in the previous example causes the dialog to be
automatically popped down. The Motif Style Guide says that when any button in the action area of a predefined Motif
dialog is pressed, except for the Help button, the dialog should be dismissed. The Motif toolkit takes this specification
at face value ...