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."