Gtk.Shortcut

g GObject.Object GObject.Object Gtk.Shortcut Gtk.Shortcut GObject.Object->Gtk.Shortcut

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (trigger, action)

get_action ()

get_arguments ()

get_trigger ()

set_action (action)

set_arguments (args)

set_trigger (trigger)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

action

Gtk.ShortcutAction

r/w/en

arguments

GLib.Variant

r/w/en

trigger

Gtk.ShortcutTrigger

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.Shortcut(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gtk.ShortcutClass

A GtkShortcut describes a keyboard shortcut.

It contains a description of how to trigger the shortcut via a [class`Gtk`.ShortcutTrigger] and a way to activate the shortcut on a widget via a [class`Gtk`.ShortcutAction].

The actual work is usually done via [class`Gtk`.ShortcutController], which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on ``GtkWidget``s that make it easier to use shortcuts in GTK.

GtkShortcut does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.

classmethod new(trigger, action)[source]
Parameters:
Returns:

a new GtkShortcut

Return type:

Gtk.Shortcut

Creates a new GtkShortcut that is triggered by trigger and then activates action.

get_action()[source]
Returns:

the action

Return type:

Gtk.ShortcutAction or None

Gets the action that is activated by this shortcut.

get_arguments()[source]
Returns:

the arguments

Return type:

GLib.Variant or None

Gets the arguments that are passed when activating the shortcut.

get_trigger()[source]
Returns:

the trigger used

Return type:

Gtk.ShortcutTrigger or None

Gets the trigger used to trigger self.

set_action(action)[source]
Parameters:

action (Gtk.ShortcutAction or None) – The new action. If the action is None, the nothing action will be used.

Sets the new action for self to be action.

set_arguments(args)[source]
Parameters:

args (GLib.Variant or None) – arguments to pass when activating self

Sets the arguments to pass when activating the shortcut.

set_trigger(trigger)[source]
Parameters:

trigger (Gtk.ShortcutTrigger or None) – The new trigger. If the trigger is None, the never trigger will be used.

Sets the new trigger for self to be trigger.

Property Details

Gtk.Shortcut.props.action
Name:

action

Type:

Gtk.ShortcutAction

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The action that gets activated by this shortcut.

Gtk.Shortcut.props.arguments
Name:

arguments

Type:

GLib.Variant

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Arguments passed to activation.

Gtk.Shortcut.props.trigger
Name:

trigger

Type:

Gtk.ShortcutTrigger

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The trigger that triggers this shortcut.