FileDialog

open class FileDialog(pointer: <Error class: unknown class><<Error class: unknown class>>)

A GtkFileDialog object collects the arguments that are needed to present a file chooser dialog to the user, such as a title for the dialog and whether it should be modal.

The dialog is shown with method@Gtk.FileDialog.open, method@Gtk.FileDialog.save, etc.

Since

4.10

Constructors

Link copied to clipboard
constructor()

Creates a new GtkFileDialog object.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var acceptLabel: String?

Label for the file chooser's accept button.

Link copied to clipboard

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

Link copied to clipboard
open var filters: <Error class: unknown class>?

The list of filters.

Link copied to clipboard
val gtkFileDialogPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var initialFile: <Error class: unknown class>?

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

Link copied to clipboard
open var initialFolder: <Error class: unknown class>?

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

Link copied to clipboard
open var initialName: String?

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

Link copied to clipboard
open var modal: Boolean

Whether the file chooser dialog is modal.

Link copied to clipboard
open var title: String

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

Functions

Link copied to clipboard
open fun getAcceptLabel(): String?

Retrieves the text used by the dialog on its accept button.

Link copied to clipboard

Gets the filter that will be selected by default in the file chooser dialog.

Link copied to clipboard
open fun getFilters(): <Error class: unknown class>?

Gets the filters that will be offered to the user in the file chooser dialog.

Link copied to clipboard
open fun getInitialFile(): <Error class: unknown class>?

Gets the file that will be initially selected in the file chooser dialog.

Link copied to clipboard
open fun getInitialFolder(): <Error class: unknown class>?

Gets the folder that will be set as the initial folder in the file chooser dialog.

Link copied to clipboard
open fun getInitialName(): String?

Gets the name for the file that should be initially set.

Link copied to clipboard
open fun getModal(): Boolean

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

Link copied to clipboard
open fun getTitle(): String

Returns the title that will be shown on the file chooser dialog.

Link copied to clipboard
open fun open(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

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

Link copied to clipboard
open fun openFinish(result: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>?>

Finishes the method@Gtk.FileDialog.open call and returns the resulting file.

Link copied to clipboard
open fun openMultiple(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

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

Link copied to clipboard
open fun openMultipleFinish(result: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>?>

Finishes the method@Gtk.FileDialog.open call and returns the resulting files in a GListModel.

Link copied to clipboard
open fun save(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

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

Link copied to clipboard
open fun saveFinish(result: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>?>

Finishes the method@Gtk.FileDialog.save call and returns the resulting file.

Link copied to clipboard
open fun selectFolder(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

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

Link copied to clipboard
open fun selectFolderFinish(result: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>?>

Finishes the method@Gtk.FileDialog.select_folder call and returns the resulting file.

Link copied to clipboard
open fun selectMultipleFolders(parent: Window? = null, cancellable: <Error class: unknown class>? = null, callback: <Error class: unknown class>)

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

Link copied to clipboard
open fun selectMultipleFoldersFinish(result: <Error class: unknown class>): <Error class: unknown class><<Error class: unknown class>?>

Finishes the method@Gtk.FileDialog.select_multiple_folders call and returns the resulting files in a GListModel.

Link copied to clipboard
open fun setAcceptLabel(acceptLabel: String? = null)

Sets the label shown on the file chooser's accept button.

Link copied to clipboard
open fun setDefaultFilter(filter: FileFilter? = null)

Sets the filter that will be selected by default in the file chooser dialog.

Link copied to clipboard
open fun setFilters(filters: <Error class: unknown class>? = null)

Sets the filters that will be offered to the user in the file chooser dialog.

Link copied to clipboard
open fun setInitialFile(file: <Error class: unknown class>? = null)

Sets the file that will be initially selected in the file chooser dialog.

Link copied to clipboard
open fun setInitialFolder(folder: <Error class: unknown class>? = null)

Sets the folder that will be set as the initial folder in the file chooser dialog.

Link copied to clipboard
open fun setInitialName(name: String? = null)

Sets the name for the file that should be initially set. For saving dialogs, this will usually be pre-entered into the name field.

Link copied to clipboard
open fun setModal(modal: Boolean)

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

Link copied to clipboard
open fun setTitle(title: String)

Sets the title that will be shown on the file chooser dialog.