FileChooserWidgetProtocol
public protocol FileChooserWidgetProtocol : FileChooserProtocol, WidgetProtocol
GtkFileChooserWidget is a widget for choosing files.
It exposes the [ifaceGtk.FileChooser] interface, and you should
use the methods of this interface to interact with the
widget.
CSS nodes
GtkFileChooserWidget has a single CSS node with name filechooser.
The FileChooserWidgetProtocol protocol exposes the methods and properties of an underlying GtkFileChooserWidget 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 FileChooserWidget.
Alternatively, use FileChooserWidgetRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkFileChooserWidgetinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
file_chooser_widget_ptrDefault implementationTyped pointer to the underlying
GtkFileChooserWidgetinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkFileChooserWidgetinstance.Declaration
Swift
var file_chooser_widget_ptr: UnsafeMutablePointer<GtkFileChooserWidget>! { get } -
Required Initialiser for types conforming to
FileChooserWidgetProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
FileChooserWidgetPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: FileChooserWidgetPropertyName, 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 FileChooserWidget property
Declaration
Swift
@inlinable func get(property: FileChooserWidgetPropertyName) -> 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 FileChooserWidget property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: FileChooserWidgetPropertyName, 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
FileChooserWidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FileChooserWidgetSignalName, 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
FileChooserWidgetSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FileChooserWidgetSignalName, 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)
-
onDesktopFolder(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the user’s Desktop folder in the file list.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>D</kbd>.
Note
This represents the underlyingdesktop-foldersignalDeclaration
Swift
@discardableResult @inlinable func onDesktopFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
desktopFoldersignal is emitted -
desktopFolderSignalExtension methodTyped
desktop-foldersignal for using theconnect(signal:)methodsDeclaration
Swift
static var desktopFolderSignal: FileChooserWidgetSignalName { get } -
onDownFolder(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser go to a child of the current folder in the file hierarchy. The subfolder that will be used is displayed in the path bar widget of the file chooser. For example, if the path bar is showing “/foo/bar/baz”, with bar currently displayed, then this will cause the file chooser to switch to the “baz” subfolder.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>Down</kbd>.
Note
This represents the underlyingdown-foldersignalDeclaration
Swift
@discardableResult @inlinable func onDownFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
downFoldersignal is emitted -
downFolderSignalExtension methodTyped
down-foldersignal for using theconnect(signal:)methodsDeclaration
Swift
static var downFolderSignal: FileChooserWidgetSignalName { get } -
onHomeFolder(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the user’s home folder in the file list.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>Home</kbd>.
Note
This represents the underlyinghome-foldersignalDeclaration
Swift
@discardableResult @inlinable func onHomeFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
homeFoldersignal is emitted -
homeFolderSignalExtension methodTyped
home-foldersignal for using theconnect(signal:)methodsDeclaration
Swift
static var homeFolderSignal: FileChooserWidgetSignalName { get } -
onLocationPopup(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show a “Location” prompt which the user can use to manually type the name of the file he wishes to select.
The default bindings for this signal are <kbd>Control</kbd>-<kbd>L</kbd> with a
pathstring of “” (the empty string). It is also bound to <kbd>/</kbd> with apathstring of “/” (a slash): this lets you type/and immediately type a path name. On Unix systems, this is bound to <kbd>~</kbd> (tilde) with apathstring of “~” itself for access to home directories.Note
This represents the underlyinglocation-popupsignalDeclaration
Swift
@discardableResult @inlinable func onLocationPopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ path: String) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
patha string that gets put in the text entry for the file name
handlerThe signal handler to call Run the given callback whenever the
locationPopupsignal is emitted -
locationPopupSignalExtension methodTyped
location-popupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var locationPopupSignal: FileChooserWidgetSignalName { get } -
onLocationPopupOnPaste(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show a “Location” prompt when the user pastes into a
GtkFileChooserWidget.The default binding for this signal is <kbd>Control</kbd>-<kbd>V</kbd>.
Note
This represents the underlyinglocation-popup-on-pastesignalDeclaration
Swift
@discardableResult @inlinable func onLocationPopupOnPaste(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
locationPopupOnPastesignal is emitted -
locationPopupOnPasteSignalExtension methodTyped
location-popup-on-pastesignal for using theconnect(signal:)methodsDeclaration
Swift
static var locationPopupOnPasteSignal: FileChooserWidgetSignalName { get } -
onLocationTogglePopup(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to toggle the visibility of a “Location” prompt which the user can use to manually type the name of the file he wishes to select.
The default binding for this signal is <kbd>Control</kbd>-<kbd>L</kbd>.
Note
This represents the underlyinglocation-toggle-popupsignalDeclaration
Swift
@discardableResult @inlinable func onLocationTogglePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
locationTogglePopupsignal is emitted -
locationTogglePopupSignalExtension methodTyped
location-toggle-popupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var locationTogglePopupSignal: FileChooserWidgetSignalName { get } -
onPlacesShortcut(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to move the focus to the places sidebar.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>P</kbd>.
Note
This represents the underlyingplaces-shortcutsignalDeclaration
Swift
@discardableResult @inlinable func onPlacesShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
placesShortcutsignal is emitted -
placesShortcutSignalExtension methodTyped
places-shortcutsignal for using theconnect(signal:)methodsDeclaration
Swift
static var placesShortcutSignal: FileChooserWidgetSignalName { get } -
onQuickBookmark(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser switch to the bookmark specified in the
bookmark_indexparameter. For example, if you have three bookmarks, you can pass 0, 1, 2 to this signal to switch to each of them, respectively.The default binding for this signal is <kbd>Alt</kbd>-<kbd>1</kbd>, <kbd>Alt</kbd>-<kbd>2</kbd>, etc. until <kbd>Alt</kbd>-<kbd>0</kbd>. Note that in the default binding, that <kbd>Alt</kbd>-<kbd>1</kbd> is actually defined to switch to the bookmark at index 0, and so on successively.
Note
This represents the underlyingquick-bookmarksignalDeclaration
Swift
@discardableResult @inlinable func onQuickBookmark(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ bookmarkIndex: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
bookmarkIndexthe number of the bookmark to switch to
handlerThe signal handler to call Run the given callback whenever the
quickBookmarksignal is emitted -
quickBookmarkSignalExtension methodTyped
quick-bookmarksignal for using theconnect(signal:)methodsDeclaration
Swift
static var quickBookmarkSignal: FileChooserWidgetSignalName { get } -
onRecentShortcut(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the Recent location.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>R</kbd>.
Note
This represents the underlyingrecent-shortcutsignalDeclaration
Swift
@discardableResult @inlinable func onRecentShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
recentShortcutsignal is emitted -
recentShortcutSignalExtension methodTyped
recent-shortcutsignal for using theconnect(signal:)methodsDeclaration
Swift
static var recentShortcutSignal: FileChooserWidgetSignalName { get } -
onSearchShortcut(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the search entry.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>S</kbd>.
Note
This represents the underlyingsearch-shortcutsignalDeclaration
Swift
@discardableResult @inlinable func onSearchShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
searchShortcutsignal is emitted -
searchShortcutSignalExtension methodTyped
search-shortcutsignal for using theconnect(signal:)methodsDeclaration
Swift
static var searchShortcutSignal: FileChooserWidgetSignalName { get } -
onShowHidden(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser display hidden files.
The default binding for this signal is <kbd>Control</kbd>-<kbd>H</kbd>.
Note
This represents the underlyingshow-hiddensignalDeclaration
Swift
@discardableResult @inlinable func onShowHidden(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
showHiddensignal is emitted -
showHiddenSignalExtension methodTyped
show-hiddensignal for using theconnect(signal:)methodsDeclaration
Swift
static var showHiddenSignal: FileChooserWidgetSignalName { get } -
onUpFolder(flags:Extension methodhandler: ) Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser go to the parent of the current folder in the file hierarchy.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>Up</kbd>.
Note
This represents the underlyingup-foldersignalDeclaration
Swift
@discardableResult @inlinable func onUpFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
upFoldersignal is emitted -
upFolderSignalExtension methodTyped
up-foldersignal for using theconnect(signal:)methodsDeclaration
Swift
static var upFolderSignal: FileChooserWidgetSignalName { get } -
onNotifySearchMode(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::search-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySearchMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ 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
notifySearchModesignal is emitted -
notifySearchModeSignalExtension methodTyped
notify::search-modesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySearchModeSignal: FileChooserWidgetSignalName { get } -
onNotifySubtitle(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::subtitlesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySubtitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ 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
notifySubtitlesignal is emitted -
notifySubtitleSignalExtension methodTyped
notify::subtitlesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySubtitleSignal: FileChooserWidgetSignalName { get }
View on GitHub
Install in Dash
FileChooserWidgetProtocol Protocol Reference