1.176 <GtkShortcutTrigger>

Class: <GtkShortcutTrigger>

It derives from <GObject>.

Tracks how a <GtkShortcut> can be activated.

To find out if a <GtkShortcutTrigger> triggers, you can call shortcut-trigger:trigger on a <GdkEvent>.

GtkShortcutTriggers contain functions that allow easy presentation to end users as well as being printed for debugging.

All GtkShortcutTriggers are immutable, you can only specify their properties during construction. If you want to change a trigger, you have to replace it with a new one.

Procedures

Method: shortcut-trigger:compare self trigger2 ⇒ %return
Method: compare self trigger2 ⇒ %return

The types of self and trigger2 are gconstpointer only to allow use of this function as a GCompareFunc.

They must each be a <GtkShortcutTrigger>.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

trigger2

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

%return

Returned: a 32-bit integer.

An integer less than, equal to, or greater than zero if self is found, respectively, to be less than, to match, or be greater than trigger2.

Method: shortcut-trigger:equal? self trigger2 ⇒ %return
Method: equal? self trigger2 ⇒ %return

Checks if self 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>.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

trigger2

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

%return

Returned: a boolean.

#t if self and trigger2 are equal

Method: shortcut-trigger:hash self ⇒ %return
Method: hash self ⇒ %return

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 self is gconstpointer only to allow use of this function with <GHashTable>. They must each be a <GtkShortcutTrigger>.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

%return

Returned: an unsigned 32-bit integer.

a hash value corresponding to self

Procedure: shortcut-trigger:parse-string string ⇒ %return

Tries to parse the given string into a trigger.

On success, the parsed trigger is returned. When parsing failed, #f is returned.

The accepted strings are:

Note that you will have to escape the < and > characters when specifying triggers in XML files, such as GtkBuilder ui files. Use &lt; instead of < and &gt; instead of >.

string

Passed: a string.

the string to parse

%return

Returned: a <GtkShortcutTrigger>, or #f.

a new <GtkShortcutTrigger>

Method: shortcut-trigger:print self string
Method: print self string

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.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

string

Passed: a <GString>.

a <GString> to print into

Method: shortcut-trigger:print-label? self display string ⇒ %return
Method: print-label? self display string ⇒ %return

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.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

display

Passed: a <GdkDisplay>.

<GdkDisplay> to print for

string

Passed: a <GString>.

a <GString> to print into

%return

Returned: a boolean.

#t if something was printed or #f if the trigger did not have a textual representation suitable for end users.

Method: shortcut-trigger:to-label self display ⇒ %return
Method: to-label self display ⇒ %return

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.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

display

Passed: a <GdkDisplay>.

<GdkDisplay> to print for

%return

Returned: a string.

a new string

Method: shortcut-trigger:to-string self ⇒ %return
Method: to-string self ⇒ %return

Prints the given trigger into a human-readable string.

This is a small wrapper around shortcut-trigger:print to help when debugging.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

%return

Returned: a string.

a new string

Method: shortcut-trigger:trigger self event enable-mnemonics ⇒ %return
Method: trigger self event enable-mnemonics ⇒ %return

Checks if the given event triggers self.

self

Passed: a <GtkShortcutTrigger>.

a <GtkShortcutTrigger>

event

Passed: a <GdkEvent>.

the event to check

enable-mnemonics

Passed: a boolean.

#t if mnemonics should trigger. Usually the value of this property is determined by checking that the passed in event is a Key event and has the right modifiers set.

%return

Returned: a <GdkKeyMatch>.

Whether the event triggered the shortcut