
Output of help_text.c
The function help_cb() is the callback routine that is invoked by all of the Help menu items. This routine follows
the steps that we outlined earlier to create the dialog box.
8.3.1 The Shell
Since the dialog is a transient dialog, we use a DialogShell widget for the shell. We create the shell as follows:
help_dialog = XtVaCreatePopupShell ("Help",
xmDialogShellWidgetClass, GetTopShell (w),
XmNdeleteResponse, XmDESTROY,
NULL);
Instead of using XtVaCreatePopupShell(), we could have used a Motif convenience routine as shown in the
following code fragment:
n = 0;
XtSetArg (args[n], XmNdeleteResponse, XmDESTROY); n++;
help_dialog = XmCreateDialogShell (GetTopShell (w), "Help", args, n);
Both methods return a DialogShell. The XmNdeleteResponse resource is set to XmDESTROY because we want the
Close item from the window menu in the window manager's titlebar for the shell to destroy the shell and its children.
The default value for this resource is XmUNMAP; had we wanted to reuse the same dialog upon each invocation, we
would have used XmUNMAP and retained a handle to the dialog widget.
The name of the dialog is Help, since that is the first parameter in the call to XtVaCreatePopupShell().
Resource specifications in a resource file that pertain to this dialog should use Help as the widget name, as shown
below:
*Help*foreground: green
The string displayed in the title bar of a ...