Libhelp Example code

The following example C code implements a full standalone help browser (with index file "libhelp-index.html"). Currently, the libhelp interface can be used with C and C++.
#include <Xm/Xm.h>
#include <help.h>

int 
main (int argc, char* argv[])
{
    XtAppContext  app_context;
    Widget        toplevel;
    char	  resource_class[] = "Xmhelp";
    char*	  help_file = "libhelp-index.html";

    /* here we set libhelp resources */
    help_set_resource (help_class_name, (XtPointer) resource_class); 
    help_set_resource (help_standalone, (XtPointer) True);
    help_set_resource (help_index, help_file);

    toplevel = XtVaAppInitialize (&app_context, resource_class, NULL, 0,
				  &argc, argv, NULL, NULL);

    /* here we request the help document */
    get_help (toplevel, help_file, NULL);
    
    XtRealizeWidget (toplevel);
    XtAppMainLoop (app_context);
}
Link it to libhelp, libhtmlw, libButtFace, libXpm and the Motif and X11 libraries needed on your system (e.g -lhelp -lhtmlw -lButtFace -lXpm -lXm -lXt -lXmu -lX11 -lXext ...).

Finally, add X-resources to the Xmhelp app-defaults file to set the default size and your favorite background (or include fallback resources).

*Background:	#bfbfbfbfbfbf
*help*geometry:	580x560-0-0

-----------

Libhelp version 1.8.1 (Jun 28. 95).
Thomas Harrer