Include the appropriate header files:
#include <Help.h> #include <HelpDialog.h>
Create an instance of the general help dialog widget:
Use the DtCreateHelpDialog() convenience function.
Or, use the XtCreateManagedWidget() function.
Add a callback for handling hyperlink events that occur within the dialog. (For more information, see "Responding to Hyperlink Events".)
Add a close callback for handling the Close command.
The following code segment creates a general help dialog (as a child of parent) using the convenience function. The dialog is left unmanaged--presumably it is managed elsewhere in the application when a help request is made.
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);
DtCreateHelpDialog(3) man page
DtHelpDialog(3) man page