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
GtkFileChooserWidget
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
file_chooser_widget_ptr
Default implementationTyped pointer to the underlying
GtkFileChooserWidget
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkFileChooserWidget
instance.Declaration
Swift
var file_chooser_widget_ptr: UnsafeMutablePointer<GtkFileChooserWidget>! { get }
-
Required Initialiser for types conforming to
FileChooserWidgetProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
FileChooserWidgetPropertyName
source 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 : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a FileChooserWidget property
Declaration
Swift
@inlinable func get(property: FileChooserWidgetPropertyName) -> GLibObject.Value
Parameters
property
the 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
property
the 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
FileChooserWidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FileChooserWidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The 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
FileChooserWidgetSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: FileChooserWidgetSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The 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-folder
signalDeclaration
Swift
@discardableResult @inlinable func onDesktopFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
desktopFolder
signal is emitted -
desktopFolderSignal
Extension methodTyped
desktop-folder
signal 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-folder
signalDeclaration
Swift
@discardableResult @inlinable func onDownFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
downFolder
signal is emitted -
downFolderSignal
Extension methodTyped
down-folder
signal 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-folder
signalDeclaration
Swift
@discardableResult @inlinable func onHomeFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
homeFolder
signal is emitted -
homeFolderSignal
Extension methodTyped
home-folder
signal 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
path
string of “” (the empty string). It is also bound to <kbd>/</kbd> with apath
string of “/
” (a slash): this lets you type/
and immediately type a path name. On Unix systems, this is bound to <kbd>~</kbd> (tilde) with apath
string of “~” itself for access to home directories.Note
This represents the underlyinglocation-popup
signalDeclaration
Swift
@discardableResult @inlinable func onLocationPopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ path: String) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
path
a string that gets put in the text entry for the file name
handler
The signal handler to call Run the given callback whenever the
locationPopup
signal is emitted -
locationPopupSignal
Extension methodTyped
location-popup
signal 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-paste
signalDeclaration
Swift
@discardableResult @inlinable func onLocationPopupOnPaste(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
locationPopupOnPaste
signal is emitted -
locationPopupOnPasteSignal
Extension methodTyped
location-popup-on-paste
signal 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-popup
signalDeclaration
Swift
@discardableResult @inlinable func onLocationTogglePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
locationTogglePopup
signal is emitted -
locationTogglePopupSignal
Extension methodTyped
location-toggle-popup
signal 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-shortcut
signalDeclaration
Swift
@discardableResult @inlinable func onPlacesShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
placesShortcut
signal is emitted -
placesShortcutSignal
Extension methodTyped
places-shortcut
signal 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_index
parameter. 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-bookmark
signalDeclaration
Swift
@discardableResult @inlinable func onQuickBookmark(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ bookmarkIndex: Int) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
bookmarkIndex
the number of the bookmark to switch to
handler
The signal handler to call Run the given callback whenever the
quickBookmark
signal is emitted -
quickBookmarkSignal
Extension methodTyped
quick-bookmark
signal 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-shortcut
signalDeclaration
Swift
@discardableResult @inlinable func onRecentShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
recentShortcut
signal is emitted -
recentShortcutSignal
Extension methodTyped
recent-shortcut
signal 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-shortcut
signalDeclaration
Swift
@discardableResult @inlinable func onSearchShortcut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
searchShortcut
signal is emitted -
searchShortcutSignal
Extension methodTyped
search-shortcut
signal 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-hidden
signalDeclaration
Swift
@discardableResult @inlinable func onShowHidden(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
showHidden
signal is emitted -
showHiddenSignal
Extension methodTyped
show-hidden
signal 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-folder
signalDeclaration
Swift
@discardableResult @inlinable func onUpFolder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
handler
The signal handler to call Run the given callback whenever the
upFolder
signal is emitted -
upFolderSignal
Extension methodTyped
up-folder
signal 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 innotify
being 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-mode
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySearchMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySearchMode
signal is emitted -
notifySearchModeSignal
Extension methodTyped
notify::search-mode
signal 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 innotify
being 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::subtitle
signalDeclaration
Swift
@discardableResult @inlinable func onNotifySubtitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: FileChooserWidgetRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifySubtitle
signal is emitted -
notifySubtitleSignal
Extension methodTyped
notify::subtitle
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySubtitleSignal: FileChooserWidgetSignalName { get }