Gtk.BindingSet

Fields

Name Type Access Description
class_branch_pspecs [object] r/w unused
current Gtk.BindingEntry r/w implementation detail
entries Gtk.BindingEntry r/w the key binding entries in this binding set
parsed int r/w whether this binding set stems from a CSS file and is reset upon theme changes
priority int r/w unused
set_name str r/w unique name of this binding set
widget_class_pspecs [object] r/w unused
widget_path_pspecs [object] r/w unused

Methods

class find (set_name)
  activate (keyval, modifiers, object)
  add_path (path_type, path_pattern, priority)

Details

class Gtk.BindingSet

A binding set maintains a list of activatable key bindings. A single binding set can match multiple types of widgets. Similar to style contexts, can be matched by any information contained in a widgets Gtk.WidgetPath. When a binding within a set is matched upon activation, an action signal is emitted on the target widget to carry out the actual activation.

classmethod find(set_name)[source]
Parameters:set_name (str) – unique binding set name
Returns:None or the specified binding set
Return type:Gtk.BindingSet or None

Find a binding set by its globally unique name.

The set_name can either be a name used for gtk_binding_set_new() or the type name of a class used in gtk_binding_set_by_class().

activate(keyval, modifiers, object)[source]
Parameters:
  • keyval (int) – key value of the binding
  • modifiers (Gdk.ModifierType) – key modifier of the binding
  • object (GObject.Object) – object to activate when binding found
Returns:

True if a binding was found and activated

Return type:

bool

Find a key binding matching keyval and modifiers within self and activate the binding on object.

add_path(path_type, path_pattern, priority)[source]
Parameters:

This function was used internally by the GtkRC parsing mechanism to assign match patterns to Gtk.BindingSet structures.

In GTK+ 3, these match patterns are unused.

Deprecated since version 3.0.