Add to your Help menu a button labeled Using Help. Also add the necessary activate callback to call your HelpRequestCB() function.
Add support to your HelpRequestCB() function to display help on help. Specifically:
Create a quick help dialog.
Set the dialog's title to Help On Help.
Display the home topic of the help on help volume.
Manage the quick help dialog.
The following lines create a menu button labeled Using Help... that calls the HelpRequestCB() function.
/* Create the ` Using Help ...' button. */
labelStr = XmStringCreateLtoR ("Using Help ...", XmSTRING_DEFAULT_CHARSET); ac = 0; XtSetArg (al[ac], XmNlabelString, labelStr); ac++; button = XmCreatePushButtonGadget (parent, "usingHelpButton", al, ac); XtManageChild (button); XmStringFree (labelStr); /* Add a callback to the button. */ XtAddCallback (button,XmNactivateCallback,HelpRequestCB, USING_HELP);
USING_HELP is the client data passed to the HelpRequestCB() function when the menu button is chosen by the user. Presumably it has been defined somewhere in the application (perhaps in a Help.h file) as a unique integer:
#define USING_HELP 47
To see how the HelpRequestCB() function handles the USING_HELP case, see the example in the next section, "To Display Help on Help."