425 lines
25 KiB
Swift
425 lines
25 KiB
Swift
// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
|
|
|
|
import Adw
|
|
import Gtk
|
|
import Gio
|
|
import Gdk
|
|
|
|
// PorticoGen: generateStruct | source: Gtk.AppChooserWidget
|
|
/// `GtkAppChooserWidget` is a widget for selecting applications.
|
|
///
|
|
/// It is the main building block for [class`Gtk`.AppChooserDialog].
|
|
/// Most applications only need to use the latter; but you can use
|
|
/// this widget as part of a larger widget if you have special needs.
|
|
///
|
|
/// `GtkAppChooserWidget` offers detailed control over what applications
|
|
/// are shown, using the
|
|
/// [property`Gtk`.AppChooserWidget:show-default],
|
|
/// [property`Gtk`.AppChooserWidget:show-recommended],
|
|
/// [property`Gtk`.AppChooserWidget:show-fallback],
|
|
/// [property`Gtk`.AppChooserWidget:show-other] and
|
|
/// [property`Gtk`.AppChooserWidget:show-all] properties. See the
|
|
/// [iface`Gtk`.AppChooser] documentation for more information about these
|
|
/// groups of applications.
|
|
///
|
|
/// To keep track of the selected application, use the
|
|
/// [signal`Gtk`.AppChooserWidget::application-selected] and
|
|
/// [signal`Gtk`.AppChooserWidget::application-activated] signals.
|
|
///
|
|
/// ## CSS nodes
|
|
///
|
|
/// `GtkAppChooserWidget` has a single CSS node with name appchooser.
|
|
///
|
|
/// A Portico view that mounts a `Gtk.AppChooserWidget`.
|
|
@MainActor public struct AppChooserWidget: View {
|
|
private let make: (MountContext) -> Gtk.AppChooserWidget
|
|
private var configure: [(Gtk.AppChooserWidget, MountContext) -> Void] = []
|
|
|
|
public var body: Never { fatalError() }
|
|
|
|
// PorticoGen: generateInits(static) | source: Gtk.AppChooserWidget.init(contentType:)
|
|
/// Creates a new `GtkAppChooserWidget` for applications
|
|
/// that can handle content of the given type.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for values that change.
|
|
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
|
|
///
|
|
/// - Parameter contentType: The `contentType` value forwarded to `Gtk.AppChooserWidget`.
|
|
/// - Parameter defaultText: The text that appears in the widget when there are no applications for the given content type.
|
|
/// - Parameter showAll: If `true`, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.
|
|
/// - Parameter showDefault: Determines whether the app chooser should show the default handler for the content type in a separate section.
|
|
/// - Parameter showFallback: Determines whether the app chooser should show a section for fallback applications.
|
|
/// - Parameter showOther: Determines whether the app chooser should show a section for other applications.
|
|
/// - Parameter showRecommended: Determines whether the app chooser should show a section for recommended applications.
|
|
/// - Parameter onApplicationActivated: Invoked when the widget emits the `application-activated` signal. The closure receives the signal's arguments in order.
|
|
/// - Parameter onApplicationSelected: Invoked when the widget emits the `application-selected` signal. The closure receives the signal's arguments in order.
|
|
public init(contentType: String, defaultText: String? = nil, showAll: Bool? = nil, showDefault: Bool? = nil, showFallback: Bool? = nil, showOther: Bool? = nil, showRecommended: Bool? = nil, onApplicationActivated: ((Gtk.AppInfo) -> Void)? = nil, onApplicationSelected: ((Gtk.AppInfo) -> Void)? = nil) {
|
|
make = { _ in Gtk.AppChooserWidget(contentType: contentType) }
|
|
configure.append { w, ctx in
|
|
if let defaultText { w.setDefaultText(text: defaultText) }
|
|
if let showAll { w.setShowAll(setting: showAll) }
|
|
if let showDefault { w.setShowDefault(setting: showDefault) }
|
|
if let showFallback { w.setShowFallback(setting: showFallback) }
|
|
if let showOther { w.setShowOther(setting: showOther) }
|
|
if let showRecommended { w.setShowRecommended(setting: showRecommended) }
|
|
if let onApplicationActivated { ctx.registry.add(w.connectApplicationActivated { _, a0 in onApplicationActivated(a0) }) }
|
|
if let onApplicationSelected { ctx.registry.add(w.connectApplicationSelected { _, a0 in onApplicationSelected(a0) }) }
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
extension AppChooserWidget: WidgetView {
|
|
public typealias Target = Gtk.AppChooserWidget
|
|
|
|
@_spi(Portico) public func appending(
|
|
_ step: @escaping (Gtk.AppChooserWidget, MountContext) -> Void
|
|
) -> Self {
|
|
var c = self
|
|
c.configure.append(step)
|
|
return c
|
|
}
|
|
}
|
|
|
|
@_spi(Portico) extension AppChooserWidget: Mountable {
|
|
@_spi(Portico) public func mount(_ ctx: MountContext) -> Gtk.Widget {
|
|
let w = make(ctx)
|
|
for step in configure { step(w, ctx) }
|
|
return w
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension | source: Gtk.AppChooserWidget
|
|
/// Modifiers for `Gtk.AppChooserWidget`, available on every Portico view whose
|
|
/// backing widget is `Gtk.AppChooserWidget` or one of its subclasses.
|
|
extension WidgetView where Target: Gtk.AppChooserWidget {
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setDefaultText(text:)
|
|
/// Sets the text that is shown if there are not applications
|
|
/// that can handle the content type.
|
|
///
|
|
/// Applied once at mount; use the `Binding`, closure, or `InterpolatedText` overload for a value that changes.
|
|
/// A string literal containing interpolation selects the `InterpolatedText` overload instead, which updates live.
|
|
///
|
|
/// - Parameter defaultText: The text that appears in the widget when there are no applications for the given content type.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
@_disfavoredOverload
|
|
public func defaultText<S: StringProtocol>(_ defaultText: S) -> Self {
|
|
appending { w, _ in
|
|
w.setDefaultText(text: String(defaultText))
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setDefaultText(text:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getDefaultText()
|
|
/// Sets the text that is shown if there are not applications
|
|
/// that can handle the content type.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `String` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func defaultText(_ defaultText: Portico.Binding<String>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, defaultText, registry: ctx.registry, notifyDetail: "default-text",
|
|
read: { [w] in w.getDefaultText() },
|
|
write: { [w] v in w.setDefaultText(text: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setDefaultText(text:)
|
|
/// Sets the text that is shown if there are not applications
|
|
/// that can handle the content type.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setDefaultText(text:)`.
|
|
///
|
|
/// - Parameter defaultText: The text that appears in the widget when there are no applications for the given content type.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func defaultText(_ defaultText: @escaping () -> String) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setDefaultText(text: defaultText()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(interpolation) | source: Gtk.AppChooserWidget.setDefaultText(text:)
|
|
/// Sets the text that is shown if there are not applications
|
|
/// that can handle the content type.
|
|
///
|
|
/// Interpolated segments are captured unevaluated and re-read inside a `DependencyTracker`, so any `@State` they read pushes a new value through `Gtk.AppChooserWidget.setDefaultText(text:)`. A literal with no interpolation is applied once, with no subscription.
|
|
///
|
|
/// - Parameter defaultText: The text that appears in the widget when there are no applications for the given content type.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func defaultText(_ defaultText: Portico.InterpolatedText) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindInterpolation(defaultText, registry: ctx.registry) { [w] v in w.setDefaultText(text: v) }
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setShowAll(setting:)
|
|
/// Sets whether the app chooser should show all applications
|
|
/// in a flat list.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter showAll: If `true`, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showAll(_ showAll: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setShowAll(setting: showAll)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setShowAll(setting:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getShowAll()
|
|
/// Sets whether the app chooser should show all applications
|
|
/// in a flat list.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showAll(_ showAll: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, showAll, registry: ctx.registry, notifyDetail: "show-all",
|
|
read: { [w] in w.getShowAll() },
|
|
write: { [w] v in w.setShowAll(setting: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setShowAll(setting:)
|
|
/// Sets whether the app chooser should show all applications
|
|
/// in a flat list.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setShowAll(setting:)`.
|
|
///
|
|
/// - Parameter showAll: If `true`, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showAll(_ showAll: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setShowAll(setting: showAll()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setShowDefault(setting:)
|
|
/// Sets whether the app chooser should show the default handler
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter showDefault: Determines whether the app chooser should show the default handler for the content type in a separate section.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showDefault(_ showDefault: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setShowDefault(setting: showDefault)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setShowDefault(setting:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getShowDefault()
|
|
/// Sets whether the app chooser should show the default handler
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showDefault(_ showDefault: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, showDefault, registry: ctx.registry, notifyDetail: "show-default",
|
|
read: { [w] in w.getShowDefault() },
|
|
write: { [w] v in w.setShowDefault(setting: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setShowDefault(setting:)
|
|
/// Sets whether the app chooser should show the default handler
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setShowDefault(setting:)`.
|
|
///
|
|
/// - Parameter showDefault: Determines whether the app chooser should show the default handler for the content type in a separate section.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showDefault(_ showDefault: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setShowDefault(setting: showDefault()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setShowFallback(setting:)
|
|
/// Sets whether the app chooser should show related applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter showFallback: Determines whether the app chooser should show a section for fallback applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showFallback(_ showFallback: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setShowFallback(setting: showFallback)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setShowFallback(setting:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getShowFallback()
|
|
/// Sets whether the app chooser should show related applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showFallback(_ showFallback: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, showFallback, registry: ctx.registry, notifyDetail: "show-fallback",
|
|
read: { [w] in w.getShowFallback() },
|
|
write: { [w] v in w.setShowFallback(setting: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setShowFallback(setting:)
|
|
/// Sets whether the app chooser should show related applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setShowFallback(setting:)`.
|
|
///
|
|
/// - Parameter showFallback: Determines whether the app chooser should show a section for fallback applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showFallback(_ showFallback: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setShowFallback(setting: showFallback()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setShowOther(setting:)
|
|
/// Sets whether the app chooser should show applications
|
|
/// which are unrelated to the content type.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter showOther: Determines whether the app chooser should show a section for other applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showOther(_ showOther: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setShowOther(setting: showOther)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setShowOther(setting:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getShowOther()
|
|
/// Sets whether the app chooser should show applications
|
|
/// which are unrelated to the content type.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showOther(_ showOther: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, showOther, registry: ctx.registry, notifyDetail: "show-other",
|
|
read: { [w] in w.getShowOther() },
|
|
write: { [w] v in w.setShowOther(setting: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setShowOther(setting:)
|
|
/// Sets whether the app chooser should show applications
|
|
/// which are unrelated to the content type.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setShowOther(setting:)`.
|
|
///
|
|
/// - Parameter showOther: Determines whether the app chooser should show a section for other applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showOther(_ showOther: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setShowOther(setting: showOther()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.AppChooserWidget.setShowRecommended(setting:)
|
|
/// Sets whether the app chooser should show recommended applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
|
|
///
|
|
/// - Parameter showRecommended: Determines whether the app chooser should show a section for recommended applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showRecommended(_ showRecommended: Bool) -> Self {
|
|
appending { w, _ in
|
|
w.setShowRecommended(setting: showRecommended)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.AppChooserWidget.setShowRecommended(setting:), GObject.Object.connectNotify(detail:_:), Gtk.AppChooserWidget.getShowRecommended()
|
|
/// Sets whether the app chooser should show recommended applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// Applied at mount and re-applied on every change the binding publishes.
|
|
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
|
|
///
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showRecommended(_ showRecommended: Portico.Binding<Bool>) -> Self {
|
|
appending { w, ctx in
|
|
Portico.bindProperty(
|
|
w, showRecommended, registry: ctx.registry, notifyDetail: "show-recommended",
|
|
read: { [w] in w.getShowRecommended() },
|
|
write: { [w] v in w.setShowRecommended(setting: v) }
|
|
)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.AppChooserWidget.setShowRecommended(setting:)
|
|
/// Sets whether the app chooser should show recommended applications
|
|
/// for the content type in a separate section.
|
|
///
|
|
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.AppChooserWidget.setShowRecommended(setting:)`.
|
|
///
|
|
/// - Parameter showRecommended: Determines whether the app chooser should show a section for recommended applications.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func showRecommended(_ showRecommended: @escaping () -> Bool) -> Self {
|
|
appending { w, ctx in
|
|
let tracker = DependencyTracker { [w] in w.setShowRecommended(setting: showRecommended()) }
|
|
tracker.run()
|
|
ctx.registry.add(tracker)
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.AppChooserWidget.connectApplicationActivated(_:)
|
|
/// Emitted when an application item is activated from the widget's list.
|
|
///
|
|
/// This usually happens when the user double clicks an item, or an item
|
|
/// is selected and the user presses one of the keys Space, Shift+Space,
|
|
/// Return or Enter.
|
|
///
|
|
/// - Parameter handler: Invoked when the widget emits the `application-activated` signal. The closure receives the signal's arguments in order.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func onApplicationActivated(_ handler: @escaping (Gtk.AppInfo) -> Void) -> Self {
|
|
appending { w, ctx in
|
|
ctx.registry.add(w.connectApplicationActivated { _, a0 in handler(a0) })
|
|
}
|
|
}
|
|
|
|
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.AppChooserWidget.connectApplicationSelected(_:)
|
|
/// Emitted when an application item is selected from the widget's list.
|
|
///
|
|
/// - Parameter handler: Invoked when the widget emits the `application-selected` signal. The closure receives the signal's arguments in order.
|
|
/// - Returns: A copy of this view with the modifier applied.
|
|
public func onApplicationSelected(_ handler: @escaping (Gtk.AppInfo) -> Void) -> Self {
|
|
appending { w, ctx in
|
|
ctx.registry.add(w.connectApplicationSelected { _, a0 in handler(a0) })
|
|
}
|
|
}
|
|
|
|
}
|