FileChooserWidgetProtocol

public protocol FileChooserWidgetProtocol : BoxProtocol, FileChooserProtocol

GtkFileChooserWidget is a widget for choosing files. It exposes the GtkFileChooser 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.

  • ptr

    Untyped pointer to the underlying GtkFileChooserWidget instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • file_chooser_widget_ptr Default implementation

    Typed 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)

FileChooserWidget Class

  • 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 transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return 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:value:) Extension method

    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

FileChooserWidget signals

  • Connect a Swift signal handler to the given, typed FileChooserWidgetSignalName signal

    Declaration

    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 by userData

    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 a C signal handler to the given, typed FileChooserWidgetSignalName signal

    Declaration

    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 by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • The desktop-folder signal is a keybinding signal which gets emitted when the user asks for it.

    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 Alt + D.

    Note

    This represents the underlying desktop-folder signal

    Declaration

    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 method

    Typed desktop-folder signal for using the connect(signal:) methods

    Declaration

    Swift

    static var desktopFolderSignal: FileChooserWidgetSignalName { get }
  • onDownFolder(flags:handler:) Extension method

    The down-folder signal is a keybinding signal which gets emitted when the user asks for it.

    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 Alt + Down.

    Note

    This represents the underlying down-folder signal

    Declaration

    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 method

    Typed down-folder signal for using the connect(signal:) methods

    Declaration

    Swift

    static var downFolderSignal: FileChooserWidgetSignalName { get }
  • onHomeFolder(flags:handler:) Extension method

    The home-folder signal is a keybinding signal which gets emitted when the user asks for it.

    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 Alt + Home.

    Note

    This represents the underlying home-folder signal

    Declaration

    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 method

    Typed home-folder signal for using the connect(signal:) methods

    Declaration

    Swift

    static var homeFolderSignal: FileChooserWidgetSignalName { get }
  • The location-popup signal is a keybinding signal which gets emitted when the user asks for it.

    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 Control + L with a path string of “” (the empty string). It is also bound to / with a path string of “/” (a slash): this lets you type / and immediately type a path name. On Unix systems, this is bound to ~ (tilde) with a path string of “~” itself for access to home directories.

    Note

    This represents the underlying location-popup signal

    Declaration

    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 method

    Typed location-popup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var locationPopupSignal: FileChooserWidgetSignalName { get }
  • The location-popup-on-paste signal is a keybinding signal which gets emitted when the user asks for it.

    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 Control + V.

    Note

    This represents the underlying location-popup-on-paste signal

    Declaration

    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 method

    Typed location-popup-on-paste signal for using the connect(signal:) methods

    Declaration

    Swift

    static var locationPopupOnPasteSignal: FileChooserWidgetSignalName { get }
  • The location-toggle-popup signal is a keybinding signal which gets emitted when the user asks for it.

    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 Control + L.

    Note

    This represents the underlying location-toggle-popup signal

    Declaration

    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 method

    Typed location-toggle-popup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var locationTogglePopupSignal: FileChooserWidgetSignalName { get }
  • The places-shortcut signal is a keybinding signal which gets emitted when the user asks for it.

    This is used to move the focus to the places sidebar.

    The default binding for this signal is Alt + P.

    Note

    This represents the underlying places-shortcut signal

    Declaration

    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 method

    Typed places-shortcut signal for using the connect(signal:) methods

    Declaration

    Swift

    static var placesShortcutSignal: FileChooserWidgetSignalName { get }
  • The quick-bookmark signal is a keybinding signal which gets emitted when the user asks for it.

    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 Alt + 1, Alt + 2, etc. until Alt + 0. Note that in the default binding, that Alt + 1 is actually defined to switch to the bookmark at index 0, and so on successively; Alt + 0 is defined to switch to the bookmark at index 10.

    Note

    This represents the underlying quick-bookmark signal

    Declaration

    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 method

    Typed quick-bookmark signal for using the connect(signal:) methods

    Declaration

    Swift

    static var quickBookmarkSignal: FileChooserWidgetSignalName { get }
  • The recent-shortcut signal is a keybinding signal which gets emitted when the user asks for it.

    This is used to make the file chooser show the Recent location.

    The default binding for this signal is Alt + R.

    Note

    This represents the underlying recent-shortcut signal

    Declaration

    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 method

    Typed recent-shortcut signal for using the connect(signal:) methods

    Declaration

    Swift

    static var recentShortcutSignal: FileChooserWidgetSignalName { get }
  • The search-shortcut signal is a keybinding signal which gets emitted when the user asks for it.

    This is used to make the file chooser show the search entry.

    The default binding for this signal is Alt + S.

    Note

    This represents the underlying search-shortcut signal

    Declaration

    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 method

    Typed search-shortcut signal for using the connect(signal:) methods

    Declaration

    Swift

    static var searchShortcutSignal: FileChooserWidgetSignalName { get }
  • onShowHidden(flags:handler:) Extension method

    The show-hidden signal is a keybinding signal which gets emitted when the user asks for it.

    This is used to make the file chooser display hidden files.

    The default binding for this signal is Control + H.

    Note

    This represents the underlying show-hidden signal

    Declaration

    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 method

    Typed show-hidden signal for using the connect(signal:) methods

    Declaration

    Swift

    static var showHiddenSignal: FileChooserWidgetSignalName { get }
  • onUpFolder(flags:handler:) Extension method

    The up-folder signal is a keybinding signal which gets emitted when the user asks for it.

    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 Alt + Up.

    Note

    This represents the underlying up-folder signal

    Declaration

    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 method

    Typed up-folder signal for using the connect(signal:) methods

    Declaration

    Swift

    static var upFolderSignal: FileChooserWidgetSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::search-mode signal

    Declaration

    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 method

    Typed notify::search-mode signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySearchModeSignal: FileChooserWidgetSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::subtitle signal

    Declaration

    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 method

    Typed notify::subtitle signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySubtitleSignal: FileChooserWidgetSignalName { get }

FileChooserWidget Class: FileChooserWidgetProtocol extension (methods and fields)