Gtk.ShortcutsShortcut

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.ShortcutsShortcut Gtk.ShortcutsShortcut Gtk.Widget->Gtk.ShortcutsShortcut

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

accel-size-group

Gtk.SizeGroup

w

accelerator

str

r/w

action-name

str

r/w/en

direction

Gtk.TextDirection

r/w/en

icon

Gio.Icon

r/w

icon-set

bool

r/w

shortcut-type

Gtk.ShortcutType

r/w/en

subtitle

str

r/w

subtitle-set

bool

r/w

title

str

r/w

title-size-group

Gtk.SizeGroup

w

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.ShortcutsShortcut(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Gtk.ShortcutsShortcutClass

A GtkShortcutsShortcut represents a single keyboard shortcut or gesture with a short text.

This widget is only meant to be used with GtkShortcutsWindow.

Property Details

Gtk.ShortcutsShortcut.props.accel_size_group
Name:

accel-size-group

Type:

Gtk.SizeGroup

Default Value:

None

Flags:

WRITABLE

The size group for the accelerator portion of this shortcut.

This is used internally by GTK, and must not be modified by applications.

Gtk.ShortcutsShortcut.props.accelerator
Name:

accelerator

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The accelerator(s) represented by this object.

This property is used if [property`Gtk`.ShortcutsShortcut:shortcut-type] is set to Gtk.ShortcutType.ACCELERATOR.

The syntax of this property is (an extension of) the syntax understood by [func`Gtk`.accelerator_parse]. Multiple accelerators can be specified by separating them with a space, but keep in mind that the available width is limited.

It is also possible to specify ranges of shortcuts, using ... between the keys. Sequences of keys can be specified using a + or & between the keys.

Examples:

  • A single shortcut: <ctl><alt>delete

  • Two alternative shortcuts: <shift>a Home

  • A range of shortcuts: <alt>1...<alt>9

  • Several keys pressed together: Control_L&Control_R

  • A sequence of shortcuts or keys: <ctl>c+<ctl>x

Use “+” instead of “&” when the keys may (or have to be) pressed sequentially (e.g use “t+t” for ‘press the t key twice’).

Note that <, > and & need to be escaped as &lt;, &gt; and &amp; when used in .ui files.

Gtk.ShortcutsShortcut.props.action_name
Name:

action-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A detailed action name.

If this is set for a shortcut of type Gtk.ShortcutType.ACCELERATOR, then GTK will use the accelerators that are associated with the action via [method`Gtk`.Application.set_accels_for_action], and setting [property`Gtk`.ShortcutsShortcut:accelerator] is not necessary.

Gtk.ShortcutsShortcut.props.direction
Name:

direction

Type:

Gtk.TextDirection

Default Value:

Gtk.TextDirection.NONE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The text direction for which this shortcut is active.

If the shortcut is used regardless of the text direction, set this property to Gtk.TextDirection.NONE.

Gtk.ShortcutsShortcut.props.icon
Name:

icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE

An icon to represent the shortcut or gesture.

This property is used if [property`Gtk`.ShortcutsShortcut:shortcut-type] is set to Gtk.ShortcutType.GESTURE.

For the other predefined gesture types, GTK provides an icon on its own.

Gtk.ShortcutsShortcut.props.icon_set
Name:

icon-set

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if an icon has been set.

Gtk.ShortcutsShortcut.props.shortcut_type
Name:

shortcut-type

Type:

Gtk.ShortcutType

Default Value:

Gtk.ShortcutType.ACCELERATOR

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The type of shortcut that is represented.

Gtk.ShortcutsShortcut.props.subtitle
Name:

subtitle

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

The subtitle for the shortcut or gesture.

This is typically used for gestures and should be a short, one-line text that describes the gesture itself. For the predefined gesture types, GTK provides a subtitle on its own.

Gtk.ShortcutsShortcut.props.subtitle_set
Name:

subtitle-set

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

True if a subtitle has been set.

Gtk.ShortcutsShortcut.props.title
Name:

title

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

The textual description for the shortcut or gesture represented by this object.

This should be a short string that can fit in a single line.

Gtk.ShortcutsShortcut.props.title_size_group
Name:

title-size-group

Type:

Gtk.SizeGroup

Default Value:

None

Flags:

WRITABLE

The size group for the textual portion of this shortcut.

This is used internally by GTK, and must not be modified by applications.