Method

GtkWidgetset_accel_path

Declaration [src]

void
gtk_widget_set_accel_path (
  GtkWidget* widget,
  const gchar* accel_path,
  GtkAccelGroup* accel_group
)

Description [src]

Given an accelerator group, accel_group, and an accelerator path, accel_path, sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to gtk_widget_set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See gtk_accel_map_save().)

This function is a low level function that would most likely be used by a menu creation system like GtkUIManager. If you use GtkUIManager, setting up accelerator paths will be done automatically.

Even when you you aren’t using GtkUIManager, if you only want to set up accelerators on menu items gtk_menu_item_set_accel_path() provides a somewhat more convenient interface.

Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().

Parameters

accel_path

Type: const gchar*

Path used to look up the accelerator.

The argument can be NULL.
The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
accel_group

Type: GtkAccelGroup

A GtkAccelGroup.

The argument can be NULL.
The data is owned by the caller of the method.