
An event handler for a canvas would have to track help-key events, display the help frame,
and provide the text to display in the frame. The following code fragments show how this
might be done.
...
canvas = xv_create(frame, CANVAS,
...
WIN_CONSUME_EVENTS, ..., ACTION_HELP, ..., NULL,
WIN_EVENT_PROC, my_event_handler,
NULL);
...
my_event_handler(window, event)
Xv_Window window;
Event *event;
{
if (event_action(event) == ACTION_HELP) {
xv_help_show(window, "canvas:help_info", event);
return;
}
...
}
The meaning of “canvas:help_info” is the same as the help data described earlier.
23.2.5 Help File Installation
Once the help file has been written, you should install it in /usr/lib/help on your system. If
you don’t, then the user must set the $HELPPATH environment variable correctly to point to
the path where the file actually resides. Otherwise, the user’s request for help will result in a
notice that help being posted cannot be found. Further, the file and the path to the file
(including directories and links) must be readable and searchable.
If circumstances prevent you from installing the help file in the designated area, it is not rea-
sonable to expect the user to know where the help file is. That is, do not expect that the user
has set the $HELPPATH variable correctly. You should set the environment for the user. The
path must be set to include at least two pathnames: /usr/lib/help and the path to your help file. ...