## GimpHelpUI

GimpHelpUI — Functions for setting GtkTooltips and HTML links into the GIMP help system.

## Synopsis

    void        (*GimpHelpFunc)                 (const gchar *help_id,
                                                 gpointer data);
    void        gimp_help_enable_tooltips       (void);
    void        gimp_help_disable_tooltips      (void);
    void        gimp_standard_help_func         (const gchar *help_id,
                                                 gpointer help_data);
    void        gimp_help_connect               (GtkWidget *widget,
                                                 GimpHelpFunc help_func,
                                                 const gchar *help_id,
                                                 gpointer help_data);
    void        gimp_help_set_help_data         (GtkWidget *widget,
                                                 const gchar *tooltip,
                                                 const gchar *help_id);
    void        gimp_context_help               (void);

## Description

## Details

### GimpHelpFunc ()

    void        (*GimpHelpFunc)                 (const gchar *help_id,
                                                 gpointer data);

This is the prototype for all functions you pass as `help_func` to the various GIMP dialog constructors like gimp_dialog_new(), gimp_query_int_box() etc.

Note that all help paths are relative to the root of the help system in the current language. So if your language is "C", a help path of "filters/foo_bar.html" will expand to "${gimp_data_dir}/help/C/filters/foo_bar.html".

All these functions finally call gimp_help_connect_help_accel() which does the work of installing the "F1" accelerator.

In most cases it will be ok to use gimp_plugin_help_func() which does nothing but passing the `help_data` string to gimp_help(). If your plug-in needs some more sophisticated help handling you can provide your own `help_func` which has to call gimp_help() to actually display the help.

`help_id` : |
`data` : |

### gimp_help_enable_tooltips ()

    void        gimp_help_enable_tooltips       (void);

This function calls gtk_tooltips_enable().

### gimp_help_disable_tooltips ()

    void        gimp_help_disable_tooltips      (void);

This function calls gtk_tooltips_disable().

### gimp_standard_help_func ()

    void        gimp_standard_help_func         (const gchar *help_id,
                                                 gpointer help_data);

This is the standard GIMP help function which does nothing but calling gimp_help(). Please use gimp_plugin_help_func() for your plug-in's help links.

Currently, gimp_standard_help_func() and gimp_plugin_help_func() do exactly the same. The latter one was introduced to ensure future flexibility.

See GimpHelpFunc for the naming conventions of HTML help files.

`help_id` : |
`help_data` : | A string containing the path to a HTML page.

### gimp_help_connect ()

    void        gimp_help_connect               (GtkWidget *widget,
                                                 GimpHelpFunc help_func,
                                                 const gchar *help_id,
                                                 gpointer help_data);

Note that this function is automatically called by all libgimp dialog constructors. You only have to call it for windows/dialogs you created "manually".

`widget` : | The widget you want to connect the help accelerator for. Will be a GtkWindow in most cases.
`help_func` : | The function which will be called if the user presses "F1".
`help_id` : | The help_id which will be passed to `help_func`.
`help_data` : | The help_data pointer which will be passed to `help_func`.

### gimp_help_set_help_data ()

    void        gimp_help_set_help_data         (GtkWidget *widget,
                                                 const gchar *tooltip,
                                                 const gchar *help_id);

The reason why we don't use gtk_tooltips_set_tip() is that it's impossible to set a `private_tip` (aka `help_id`) without a visible `tooltip`.

This function can be called with `NULL` for `tooltip`. Use this feature if you want to set a help link for a widget which shouldn't have a visible tooltip.

`widget` : | The GtkWidget you want to set a `tooltip` and/or `help_data` for.
`tooltip` : | The text for this widget's tooltip (or `NULL`).
`help_id` : | The `help_id` for the GtkTipsQuery tooltips inspector.

### gimp_context_help ()

    void        gimp_context_help               (void);

This function invokes the GtkTipsQuery tooltips inspector.

The mouse cursor will turn turn into a question mark and the user can click on any widget of the application which started the inspector.

If the widget the user clicked on has a `help_id` string attached (see gimp_help_set_help_data()), the corresponding help page will be displayed. Otherwise the help system will ascend the widget hierarchy until it finds an attached `help_id` string (which should be the case at least for every window/dialog).