ViewKit ObjectPak Help Library

ObjectPak provides a rudimentary help library, libvkhelp, that you can use if you do not want to implement your own. The ObjectPak help library does not provide extensive help browsing or other search features; however, it does allow you to include help messages for your application by defining them in the X resource database.

The source for the ObjectPak help library is included in ${ObjectPak}/Utilities/VkHelpAPI.C.Examine this source to get ideas for implementing your own help library.

The ObjectPak help library is simple enough not to require any initialization, so SGIHelpInit() is defined to simply return the value 1.

Both SGIHelpMsg() and SGIHelpIndexMsg() are defined to accept the in_key character token argument and look up the resource "in_key.helpText" in the X resource library. They then display the help text retrieved from the resource database in an OSF/Motif information dialog. If these function cannot find an appropriate resource value, they display the message "Sorry, no help available on this topic" in the dialog.

The following lines show how you create the help message specifications for an application:

*helpText: Application default help message
*row1*helpText: Help message for the row1 widgets and its descendants
*row2*helpText: Help message for the row2 widgets and its descendants
*row2*start*helpText: Special help message for start, child widget of row2
*overview*helpText: Overview help message

In this example, the "*helpText" resource specification provides a default help message for the entire application. If a widget does not have a more specific help message resource specification, the application displays this default help message.

The "*row1*helpText" and "*row2*helpText" resource specifications provide help messages for these widgets and their descendants. For example, you could use a specification like this to provide a help message for a group of toggles or pushbuttons in a RowColumn widget.

The "*row2*start*helpText" specification provides a help message for a "start" widget, a descendant of the "row2" widget. It overrides the "*row2*helpText" message.

"*overview*helpText" provides a message that the application displays when the user selects "Overview" from the Help menu.