DtHelpDialog
and DtHelpQuickDialog
.
Nearly every attribute of the help windows--including the volume name and topic ID--are manipulated as widget resources. For instance, to display a new topic, you just execute an XtSetValues() call to set the Dt
NhelpVolume, Dt
NlocationId, and Dt
NhelpType resources. For more information, refer to "Displaying Help Topics."
The general help dialog includes three dialog buttons: Backtrack, History, and Index. These commands are also available in the Help menus. For an overview of the Help dialogs and the graphical user interface, refer to the section, "Help User Interface."
Figure 9-1 General help dialog
#include <Help.h>
#include <HelpDialog.h>
Or, use the XtCreateManagedWidget() function.
Widget mainHelpDialog, moreButton, helpButton;
ac = 0;
XtSetArg (al[ac], XmNtitle, "My Application - Help"); ac++;
XtSetArg (al[ac], DtNhelpVolume, "My Help Volume"); ac++;
XtSetArg (al[ac], DtNlocationId, "Getting Started"); ac++;
XtSetArg (al[ac], DtNhelpType, "DtHELP_TYPE_TOPIC"); ac++;
mainHelpDialog =
DtCreateHelpDialog (parent, "mainHelpDialog", al, ac);
The following two calls add the hyperlink and close callbacks to the dialog. Presumably, the functions HyperlinkCB() and CloseHelpCB() are declared elsewhere in the application.
XtAddCallback (mainHelpDialog, DtNhyperLinkCallback,
HyperlinkCB, (XtPointer)NULL);
XtAddCallback (mainHelpDialog, DtNcloseCallback,
CloseHelpCB, (XtPointer)NULL);
Figure 9-2 Quick help dialog with four standard buttons
The quick help dialog has five buttons, four of which are managed. The remaining dialog button is configurable, so this button can be used for anything. However, its intended purpose is to provide a path to more help in one of these two ways:
DtHelpQuickDialogGetChild()
, for determining the widget ID for any of the quick help dialog buttons.
#include <Help.h>
#include <HelpQuickD.h>
Or, use the XtCreateManagedWidget() function.
Widget quickHelpDialog, moreButton, helpButton;
ac = 0;
XtSetArg (al[ac], XmNtitle, "My Application - Help"); ac++;
XtSetArg (al[ac], DtNhelpVolume, "My Help Volume"); ac++;
XtSetArg (al[ac], DtNlocationId, "Getting Started"); ac++;
XtSetArg (al[ac], DtNhelpType, "DtHELP_TYPE_TOPIC"); ac++;
quickHelpDialog =
DtCreateHelpQuickDialog (parent, "quickHelpDialog", al, ac);
The following two calls add the hyperlink and close callbacks to the dialog. Presumably, the functions HyperlinkCB() and CloseHelpCB() are declared elsewhere in the application.
XtAddCallback (quickHelpDialog, DtNhyperLinkCallback,
HyperlinkCB, (XtPointer)NULL);
XtAddCallback (quickHelpDialog, DtNcloseCallback,
CloseHelpCB, (XtPointer)NULL);
Here, the application-configured button is managed and assigned an activate callback that invokes the application's MoreHelpCB() function.
moreButton = DtHelpQuickDialogGetChild (quickHelpDialog,
DT_HELP_QUICK_MORE_BUTTON);
XtManageChild (moreButton);
XtAddCallback (moreButton, XmNactivateCallback,
MoreHelpCB, (XtPointer)NULL);
To provide "help on help," the dialog's Help button is managed and a help callback is added to the dialog.
helpButton = DtHelpQuickDialogGetChild (quickHelpDialog,
DT_HELP_QUICK_HELP_BUTTON);
XtManageChild (helpButton);
XtAddCallback (quickHelpDialog,DtNhelpCallback,
HelpRequestCB, USING_HELP);
Like other OSF/Motif dialogs, when you add a help callback to a quick help dialog, it is used by both the F1 key and the Help button.
DtHelp(5)
DtHelpDialog(5)
DtHelpQuickD(5)
DtCreateHelpDialog()
DtCreateHelpQUickDialog()
DtHelpQuickDialogGetChild()
DtHelpReturnSelectedWidgetId()
DtHelpSetCatalogName()
dthelptag(1)
dthelpview(1)
dthelpgen(1)
dthelpaction(5)
dtmanaction(5)
dthelptagdtd(4) dtsdldtd(4)