ShortcutsWindowRef
public struct ShortcutsWindowRef : ShortcutsWindowProtocol, GWeakCapturing
A GtkShortcutsWindow shows brief information about the keyboard shortcuts and gestures of an application. The shortcuts can be grouped, and you can have multiple sections in this window, corresponding to the major modes of your application.
Additionally, the shortcuts can be filtered by the current view, to avoid showing information that is not relevant in the current application context.
The recommended way to construct a GtkShortcutsWindow is with GtkBuilder,
by populating a GtkShortcutsWindow
with one or more GtkShortcutsSection
objects, which contain GtkShortcutsGroups
that in turn contain objects of
class GtkShortcutsShortcut
.
A simple example:
This example has as single section. As you can see, the shortcut groups are arranged in columns, and spread across several pages if there are too many to find on a single page.
The .ui file for this example can be found here.
An example with multiple views:
This example shows a GtkShortcutsWindow
that has been configured to show only
the shortcuts relevant to the “stopwatch” view.
The .ui file for this example can be found here.
An example with multiple sections:
This example shows a GtkShortcutsWindow
with two sections, “Editor Shortcuts”
and “Terminal Shortcuts”.
The .ui file for this example can be found here.
The ShortcutsWindowRef
type acts as a lightweight Swift reference to an underlying GtkShortcutsWindow
instance.
It exposes methods that can operate on this data type through ShortcutsWindowProtocol
conformance.
Use ShortcutsWindowRef
only as an unowned
reference to an existing GtkShortcutsWindow
instance.
-
Untyped pointer to the underlying `GtkShortcutsWindow` instance.
For type-safe access, use the generated, typed pointer
shortcuts_window_ptr
property instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkShortcutsWindow>)
-
Designated initialiser from a constant pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkShortcutsWindow>)
-
Conditional initialiser from an optional pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkShortcutsWindow>?)
-
Conditional initialiser from an optional, non-mutable pointer to the underlying
C
data typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkShortcutsWindow>?)
-
Conditional initialiser from an optional
gpointer
Declaration
Swift
@inlinable init!(gpointer g: gpointer?)
-
Conditional initialiser from an optional, non-mutable
gconstpointer
Declaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?)
-
Reference intialiser for a related type that implements
ShortcutsWindowProtocol
Declaration
Swift
@inlinable init<T>(_ other: T) where T : ShortcutsWindowProtocol
-
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>
Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> ShortcutsWindowRef where T : ShortcutsWindowProtocol
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutsWindowProtocol
.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>)
-
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutsWindowProtocol
.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutsWindowProtocol
.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutsWindowProtocol
.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer)
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutsWindowProtocol
.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer)