Class: Gtk::FileDialog

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtk::FileDialog

Creates a new GtkFileDialog object.

Instance Method Details

#accept_labelString

Label for the file chooser's accept button.

Returns:

  • (String)

    accept-label

#accept_label=(accept_label) ⇒ String

Label for the file chooser's accept button.

Parameters:

  • accept_label (String)

Returns:

  • (String)

    accept-label

  • (String)

    accept-label

#default_filterGtk::FileFilter

The default filter, that is, the filter that is initially active in the file chooser dialog.

If the default filter is nil, the first filter of [propertyGtk.FileDialog:filters] is used as the default filter. If that property contains no filter, the dialog will be unfiltered.

If [propertyGtk.FileDialog:filters] is not nil, the default filter should be part of the list. If it is not, the dialog may choose to not make it available.

Returns:

#default_filter=(default_filter) ⇒ Gtk::FileFilter

The default filter, that is, the filter that is initially active in the file chooser dialog.

If the default filter is nil, the first filter of [propertyGtk.FileDialog:filters] is used as the default filter. If that property contains no filter, the dialog will be unfiltered.

If [propertyGtk.FileDialog:filters] is not nil, the default filter should be part of the list. If it is not, the dialog may choose to not make it available.

Parameters:

Returns:

#filtersGio::ListModel

The list of filters.

See [propertyGtk.FileDialog:default-filter] about how those two properties interact.

Returns:

  • (Gio::ListModel)

    filters

#filters=(filters) ⇒ Gio::ListModel

The list of filters.

See [propertyGtk.FileDialog:default-filter] about how those two properties interact.

Parameters:

  • filters (Gio::ListModel)

Returns:

  • (Gio::ListModel)

    filters

  • (Gio::ListModel)

    filters

#initial_fileGio::File

The initial file, that is, the file that is initially selected in the file chooser dialog

This is a utility property that sets both [propertyGtk.FileDialog:initial-folder] and [propertyGtk.FileDialog:initial-name].

Returns:

  • (Gio::File)

    initial-file

#initial_file=(initial_file) ⇒ Gio::File

The initial file, that is, the file that is initially selected in the file chooser dialog

This is a utility property that sets both [propertyGtk.FileDialog:initial-folder] and [propertyGtk.FileDialog:initial-name].

Parameters:

  • initial_file (Gio::File)

Returns:

  • (Gio::File)

    initial-file

  • (Gio::File)

    initial-file

#initial_folderGio::File

The initial folder, that is, the directory that is initially opened in the file chooser dialog

Returns:

  • (Gio::File)

    initial-folder

#initial_folder=(initial_folder) ⇒ Gio::File

The initial folder, that is, the directory that is initially opened in the file chooser dialog

Parameters:

  • initial_folder (Gio::File)

Returns:

  • (Gio::File)

    initial-folder

  • (Gio::File)

    initial-folder

#initial_nameString

The initial name, that is, the filename that is initially selected in the file chooser dialog.

Returns:

  • (String)

    initial-name

#initial_name=(initial_name) ⇒ String

The initial name, that is, the filename that is initially selected in the file chooser dialog.

Parameters:

  • initial_name (String)

Returns:

  • (String)

    initial-name

  • (String)

    initial-name

Returns whether the file chooser dialog blocks interaction with the parent window while it is presented.

Returns:

  • (Boolean)

    TRUE if the file chooser dialog is modal

#modal=(modal) ⇒ Boolean

Whether the file chooser dialog is modal.

Parameters:

  • modal (Boolean)

Returns:

  • (Boolean)

    modal

  • (Boolean)

    modal

#modal?Boolean

Whether the file chooser dialog is modal.

Returns:

  • (Boolean)

    modal

#open(parent, cancellable, callback, user_data) ⇒ nil

This function initiates a file selection operation by presenting a file chooser dialog to the user.

The callback will be called when the dialog is dismissed. It should call [methodGtk.FileDialog.open_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#open_finish(result) ⇒ Gio::File

Finishes the [methodGtk.FileDialog.open] call and returns the resulting file.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::File)

    the file that was selected. Otherwise, NULL is returned and error is set

#open_multiple(parent, cancellable, callback, user_data) ⇒ nil

This function initiates a multi-file selection operation by presenting a file chooser dialog to the user.

The file chooser will initially be opened in the directory [propertyGtk.FileDialog:initial-folder].

The callback will be called when the dialog is dismissed. It should call [methodGtk.FileDialog.open_multiple_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#open_multiple_finish(result) ⇒ Gio::ListModel

Finishes the [methodGtk.FileDialog.open] call and returns the resulting files in a GListModel.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::ListModel)

    the file that was selected, as a GListModel of GFiles. Otherwise, NULL is returned and error is set

#save(parent, cancellable, callback, user_data) ⇒ nil

This function initiates a file save operation by presenting a file chooser dialog to the user.

The callback will be called when the dialog is dismissed. It should call [methodGtk.FileDialog.save_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#save_finish(result) ⇒ Gio::File

Finishes the [methodGtk.FileDialog.save] call and returns the resulting file.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::File)

    the file that was selected. Otherwise, NULL is returned and error is set

#select_folder(parent, cancellable, callback, user_data) ⇒ nil

This function initiates a directory selection operation by presenting a file chooser dialog to the user.

If you pass initial_folder, the file chooser will initially be opened in the parent directory of that folder, otherwise, it will be in the directory [propertyGtk.FileDialog:initial-folder].

The callback will be called when the dialog is dismissed. It should call [methodGtk.FileDialog.select_folder_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#select_folder_finish(result) ⇒ Gio::File

Finishes the [methodGtk.FileDialog.select_folder] call and returns the resulting file.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::File)

    the file that was selected. Otherwise, NULL is returned and error is set

#select_multiple_folders(parent, cancellable, callback, user_data) ⇒ nil

This function initiates a multi-directory selection operation by presenting a file chooser dialog to the user.

The file chooser will initially be opened in the directory [propertyGtk.FileDialog:initial-folder].

The callback will be called when the dialog is dismissed. It should call [methodGtk.FileDialog.select_multiple_folders_finish] to obtain the result.

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#select_multiple_folders_finish(result) ⇒ Gio::ListModel

Finishes the [methodGtk.FileDialog.select_multiple_folders] call and returns the resulting files in a GListModel.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gio::ListModel)

    the file that was selected, as a GListModel of GFiles. Otherwise, NULL is returned and error is set

#titleString

A title that may be shown on the file chooser dialog.

Returns:

  • (String)

    title

#title=(title) ⇒ String

A title that may be shown on the file chooser dialog.

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title