Gtk.ShortcutsShortcut

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Box Gtk.Box Gtk.ShortcutsShortcut Gtk.ShortcutsShortcut Gtk.Box->Gtk.ShortcutsShortcut Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses

None

Methods

Inherited

Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)

Structs

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

Virtual Methods

Inherited

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

Properties

Inherited

Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)

Name

Type

Flags

Short Description

accel-size-group

Gtk.SizeGroup

w

Accelerator Size Group

accelerator

str

r/w

The accelerator keys for shortcuts of type ‘Accelerator’

action-name

str

r/w/en

The name of the action

direction

Gtk.TextDirection

r/w/en

Text direction for which this shortcut is active

icon

Gio.Icon

r/w

The icon to show for shortcuts of type ‘Other Gesture’

icon-set

bool

r/w

Whether an icon has been set

shortcut-type

Gtk.ShortcutType

r/w/en

The type of shortcut that is represented

subtitle

str

r/w

A short description for the gesture

subtitle-set

bool

r/w

Whether a subtitle has been set

title

str

r/w

A short description for the shortcut

title-size-group

Gtk.SizeGroup

w

Title Size Group

Child Properties

Inherited

Gtk.Box (5)

Style Properties

Inherited

Gtk.Widget (17)

Signals

Inherited

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Class Details

class Gtk.ShortcutsShortcut(*args, **kwargs)
Bases

Gtk.Box

Abstract

No

Structure

Gtk.ShortcutsShortcutClass

A Gtk.ShortcutsShortcut represents a single keyboard shortcut or gesture with a short text. This widget is only meant to be used with Gtk.ShortcutsWindow.

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 Gtk.ShortcutsShortcut :shortcut-type is set to Gtk.ShortcutType.ACCELERATOR.

The syntax of this property is (an extension of) the syntax understood by 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 Gtk.Application.set_accels_for_action(), and setting Gtk.ShortcutsShortcut ::accelerator is not necessary.

New in version 3.22.

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 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.