portico/Sources/Portico/Generated/ShortcutsSection.swift

27 lines
1.2 KiB
Swift

// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
import Adw
import Gtk
import Gio
import Gdk
// PorticoGen: generateModifierExtension | source: Gtk.ShortcutsSection
/// Modifiers for `Gtk.ShortcutsSection`, available on every Portico view whose
/// backing widget is `Gtk.ShortcutsSection` or one of its subclasses.
extension WidgetView where Target: Gtk.ShortcutsSection {
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.ShortcutsSection.connectChangeCurrentPage(_:)
/// Emitted when we change the current page.
///
/// The default bindings for this signal are
/// <kbd>Ctrl</kbd>+<kbd>PgUp</kbd>, <kbd>PgUp</kbd>,
/// <kbd>Ctrl</kbd>+<kbd>PgDn</kbd>, <kbd>PgDn</kbd>.
///
/// - Parameter handler: Invoked when the widget emits the `change-current-page` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Returns: A copy of this view with the modifier applied.
public func onChangeCurrentPage(_ handler: @escaping (Int32) -> Bool) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectChangeCurrentPage { _, a0 in handler(a0) })
}
}
}