AppChooserWidgetProtocol
public protocol AppChooserWidgetProtocol : AppChooserProtocol, BoxProtocol
GtkAppChooserWidget is a widget for selecting applications.
It is the main building block for GtkAppChooserDialog. 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
GtkAppChooserWidget:show-default,
GtkAppChooserWidget:show-recommended,
GtkAppChooserWidget:show-fallback,
GtkAppChooserWidget:show-other and
GtkAppChooserWidget:show-all
properties. See the GtkAppChooser documentation for more information
about these groups of applications.
To keep track of the selected application, use the
GtkAppChooserWidget::application-selected and GtkAppChooserWidget::application-activated signals.
CSS nodes
GtkAppChooserWidget has a single CSS node with name appchooser.
The AppChooserWidgetProtocol protocol exposes the methods and properties of an underlying GtkAppChooserWidget instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see AppChooserWidget.
Alternatively, use AppChooserWidgetRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkAppChooserWidgetinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
app_chooser_widget_ptrDefault implementationTyped pointer to the underlying
GtkAppChooserWidgetinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkAppChooserWidgetinstance.Declaration
Swift
var app_chooser_widget_ptr: UnsafeMutablePointer<GtkAppChooserWidget>! { get } -
Required Initialiser for types conforming to
AppChooserWidgetProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
AppChooserWidgetPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: AppChooserWidgetPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a AppChooserWidget property
Declaration
Swift
@inlinable func get(property: AppChooserWidgetPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a AppChooserWidget property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: AppChooserWidgetPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
AppChooserWidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AppChooserWidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
AppChooserWidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: AppChooserWidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onApplicationActivated(flags:Extension methodhandler: ) 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.
Note
This represents the underlyingapplication-activatedsignalDeclaration
Swift
@discardableResult @inlinable func onApplicationActivated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ application: GIO.AppInfoRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
applicationthe activated
GAppInfohandlerThe signal handler to call Run the given callback whenever the
applicationActivatedsignal is emitted -
applicationActivatedSignalExtension methodTyped
application-activatedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var applicationActivatedSignal: AppChooserWidgetSignalName { get } -
onApplicationSelected(flags:Extension methodhandler: ) Emitted when an application item is selected from the widget’s list.
Note
This represents the underlyingapplication-selectedsignalDeclaration
Swift
@discardableResult @inlinable func onApplicationSelected(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ application: GIO.AppInfoRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
applicationthe selected
GAppInfohandlerThe signal handler to call Run the given callback whenever the
applicationSelectedsignal is emitted -
applicationSelectedSignalExtension methodTyped
application-selectedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var applicationSelectedSignal: AppChooserWidgetSignalName { get } -
onPopulatePopup(flags:Extension methodhandler: ) Emitted when a context menu is about to popup over an application item. Clients can insert menu items into the provided
GtkMenuobject in the callback of this signal; the context menu will be shown over the item if at least one item has been added to the menu.Note
This represents the underlyingpopulate-popupsignalDeclaration
Swift
@discardableResult @inlinable func onPopulatePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ menu: MenuRef, _ application: GIO.AppInfoRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
menuthe
GtkMenuto populateapplicationthe current
GAppInfohandlerThe signal handler to call Run the given callback whenever the
populatePopupsignal is emitted -
populatePopupSignalExtension methodTyped
populate-popupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var populatePopupSignal: AppChooserWidgetSignalName { get } -
onNotifyDefaultText(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::default-textsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDefaultText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDefaultTextsignal is emitted -
notifyDefaultTextSignalExtension methodTyped
notify::default-textsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDefaultTextSignal: AppChooserWidgetSignalName { get } -
onNotifyShowAll(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-allsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowAll(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowAllsignal is emitted -
notifyShowAllSignalExtension methodTyped
notify::show-allsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowAllSignal: AppChooserWidgetSignalName { get } -
onNotifyShowDefault(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowDefaultsignal is emitted -
notifyShowDefaultSignalExtension methodTyped
notify::show-defaultsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowDefaultSignal: AppChooserWidgetSignalName { get } -
onNotifyShowFallback(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-fallbacksignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowFallback(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowFallbacksignal is emitted -
notifyShowFallbackSignalExtension methodTyped
notify::show-fallbacksignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowFallbackSignal: AppChooserWidgetSignalName { get } -
onNotifyShowOther(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-othersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowOther(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowOthersignal is emitted -
notifyShowOtherSignalExtension methodTyped
notify::show-othersignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowOtherSignal: AppChooserWidgetSignalName { get } -
onNotifyShowRecommended(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-recommendedsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowRecommended(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: AppChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowRecommendedsignal is emitted -
notifyShowRecommendedSignalExtension methodTyped
notify::show-recommendedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowRecommendedSignal: AppChooserWidgetSignalName { get }
-
getDefaultText()Extension methodReturns the text that is shown if there are not applications that can handle the content type.
Declaration
Swift
@inlinable func getDefaultText() -> String! -
getShowAll()Extension methodReturns the current value of the
GtkAppChooserWidget:show-allproperty.Declaration
Swift
@inlinable func getShowAll() -> Bool -
getShowDefault()Extension methodReturns the current value of the
GtkAppChooserWidget:show-defaultproperty.Declaration
Swift
@inlinable func getShowDefault() -> Bool -
getShowFallback()Extension methodReturns the current value of the
GtkAppChooserWidget:show-fallbackproperty.Declaration
Swift
@inlinable func getShowFallback() -> Bool -
getShowOther()Extension methodReturns the current value of the
GtkAppChooserWidget:show-otherproperty.Declaration
Swift
@inlinable func getShowOther() -> Bool -
getShowRecommended()Extension methodReturns the current value of the
GtkAppChooserWidget:show-recommendedproperty.Declaration
Swift
@inlinable func getShowRecommended() -> Bool -
setDefault(text:Extension method) Sets the text that is shown if there are not applications that can handle the content type.
Declaration
Swift
@inlinable func setDefault(text: UnsafePointer<gchar>!) -
setShowAll(setting:Extension method) Sets whether the app chooser should show all applications in a flat list.
Declaration
Swift
@inlinable func setShowAll(setting: Bool) -
setShowDefault(setting:Extension method) Sets whether the app chooser should show the default handler for the content type in a separate section.
Declaration
Swift
@inlinable func setShowDefault(setting: Bool) -
setShowFallback(setting:Extension method) Sets whether the app chooser should show related applications for the content type in a separate section.
Declaration
Swift
@inlinable func setShowFallback(setting: Bool) -
setShowOther(setting:Extension method) Sets whether the app chooser should show applications which are unrelated to the content type.
Declaration
Swift
@inlinable func setShowOther(setting: Bool) -
setShowRecommended(setting:Extension method) Sets whether the app chooser should show recommended applications for the content type in a separate section.
Declaration
Swift
@inlinable func setShowRecommended(setting: Bool) -
defaultTextExtension methodReturns the text that is shown if there are not applications that can handle the content type.
Declaration
Swift
@inlinable var defaultText: String! { get nonmutating set } -
showAllExtension methodReturns the current value of the
GtkAppChooserWidget:show-allproperty.Declaration
Swift
@inlinable var showAll: Bool { get nonmutating set } -
showDefaultExtension methodReturns the current value of the
GtkAppChooserWidget:show-defaultproperty.Declaration
Swift
@inlinable var showDefault: Bool { get nonmutating set } -
showFallbackExtension methodReturns the current value of the
GtkAppChooserWidget:show-fallbackproperty.Declaration
Swift
@inlinable var showFallback: Bool { get nonmutating set } -
showOtherExtension methodReturns the current value of the
GtkAppChooserWidget:show-otherproperty.Declaration
Swift
@inlinable var showOther: Bool { get nonmutating set } -
showRecommendedExtension methodReturns the current value of the
GtkAppChooserWidget:show-recommendedproperty.Declaration
Swift
@inlinable var showRecommended: Bool { get nonmutating set } -
parentExtension methodUndocumented
Declaration
Swift
@inlinable var parent: GtkBox { get }
View on GitHub
Install in Dash
AppChooserWidgetProtocol Protocol Reference