Class: Gtk::ShortcutTrigger
- Inherits:
-
Object
- Object
- Gtk::ShortcutTrigger
- Defined in:
- (unknown)
Direct Known Subclasses
AlternativeTrigger, KeyvalTrigger, MnemonicTrigger, NeverTrigger
Instance Method Summary collapse
-
#compare(trigger2) ⇒ Integer
The types of trigger1 and trigger2 are
gconstpointeronly to allow use of this function as aGCompareFunc. -
#equal(trigger2) ⇒ Boolean
Checks if trigger1 and trigger2 trigger under the same conditions.
-
#hash ⇒ Integer
Generates a hash value for a
GtkShortcutTrigger. -
#initialize(string) ⇒ Gtk::ShortcutTrigger
constructor
Tries to parse the given string into a trigger.
-
#print(string) ⇒ nil
Prints the given trigger into a string for the developer.
-
#print_label(display, string) ⇒ Boolean
Prints the given trigger into a string.
-
#to_label(display) ⇒ String
Gets textual representation for the given trigger.
-
#to_string ⇒ String
Prints the given trigger into a human-readable string.
-
#trigger(event, enable_mnemonics) ⇒ Gdk::KeyMatch
Checks if the given event triggers self.
Constructor Details
#initialize(string) ⇒ Gtk::ShortcutTrigger
Tries to parse the given string into a trigger.
On success, the parsed trigger is returned. When parsing failed, nil is returned.
The accepted strings are:
never, forGtkNeverTrigger- a string parsed by gtk_accelerator_parse(), for a
GtkKeyvalTrigger, e.g.<Control>C - underscore, followed by a single character, for
GtkMnemonicTrigger, e.g._l - two valid trigger strings, separated by a
|character, for aGtkAlternativeTrigger:<Control>q|<Control>w
Note that you will have to escape the < and > characters when specifying
triggers in XML files, such as GtkBuilder ui files. Use < instead of
< and > instead of >.
Instance Method Details
#compare(trigger2) ⇒ Integer
The types of trigger1 and trigger2 are gconstpointer only to allow
use of this function as a GCompareFunc.
They must each be a GtkShortcutTrigger.
#equal(trigger2) ⇒ Boolean
Checks if trigger1 and trigger2 trigger under the same conditions.
The types of one and two are gconstpointer only to allow use of this
function with GHashTable. They must each be a GtkShortcutTrigger.
#hash ⇒ Integer
Generates a hash value for a GtkShortcutTrigger.
The output of this function is guaranteed to be the same for a given value only per-process. It may change between different processor architectures or even different versions of GTK. Do not use this function as a basis for building protocols or file formats.
The types of trigger is gconstpointer only to allow use of this
function with GHashTable. They must each be a GtkShortcutTrigger.
#print(string) ⇒ nil
Prints the given trigger into a string for the developer. This is meant for debugging and logging.
The form of the representation may change at any time and is not guaranteed to stay identical.
#print_label(display, string) ⇒ Boolean
Prints the given trigger into a string.
This function is returning a translated string for presentation to end users for example in menu items or in help texts.
The display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names.
The form of the representation may change at any time and is not guaranteed to stay identical.
#to_label(display) ⇒ String
Gets textual representation for the given trigger.
This function is returning a translated string for presentation to end users for example in menu items or in help texts.
The display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names.
The form of the representation may change at any time and is not guaranteed to stay identical.
#to_string ⇒ String
Prints the given trigger into a human-readable string.
This is a small wrapper around [methodGtk.ShortcutTrigger.print] to help when debugging.
#trigger(event, enable_mnemonics) ⇒ Gdk::KeyMatch
Checks if the given event triggers self.