FileChooser

interface FileChooser(source)

⚠️ Deprecated ⚠️

This is deprecated since version 4.10.

Use class@Gtk.FileDialog instead

---

GtkFileChooser is an interface that can be implemented by file selection widgets.

In GTK, the main objects that implement this interface are class@Gtk.FileChooserWidget and class@Gtk.FileChooserDialog.

You do not need to write an object that implements the GtkFileChooser interface unless you are trying to adapt an existing file selector to expose a standard programming interface.

GtkFileChooser allows for shortcuts to various places in the filesystem. In the default implementation these are displayed in the left pane. It may be a bit confusing at first that these shortcuts come from various sources and in various flavours, so lets explain the terminology here:

  • Bookmarks: are created by the user, by dragging folders from the right pane to the left pane, or by using the “Add”. Bookmarks can be renamed and deleted by the user.

  • Shortcuts: can be provided by the application. For example, a Paint program may want to add a shortcut for a Clipart folder. Shortcuts cannot be modified by the user.

  • Volumes: are provided by the underlying filesystem abstraction. They are the “roots” of the filesystem.

File Names and Encodings

When the user is finished selecting files in a GtkFileChooser, your program can get the selected filenames as GFiles.

Adding options

You can add extra widgets to a file chooser to provide options that are not present in the default design, by using method@Gtk.FileChooser.add_choice. Each choice has an identifier and a user visible label; additionally, each choice can have multiple options. If a choice has no option, it will be rendered as a check button with the given label; if a choice has options, it will be rendered as a combo box.

Skipped during bindings generation

  • method filter: Property TypeInfo of getter and setter do not match

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class FileChooserImpl(gtkFileChooserPointer: <Error class: unknown class><<Error class: unknown class>>) : FileChooser

The FileChooserImpl type represents a native instance of the FileChooser interface.

Properties

Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard
abstract val gtkFileChooserPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard
open val shortcutFolders: <Error class: unknown class>

This is deprecated since version 4.10.

Functions

Link copied to clipboard
open fun addChoice(id: String, label: String, options: List<String>? = null, optionLabels: List<String>? = null)

This is deprecated since version 4.10.

Link copied to clipboard
open fun addFilter(filter: FileFilter)

This is deprecated since version 4.10.

Link copied to clipboard
open fun addShortcutFolder(folder: <Error class: unknown class>): <Error class: unknown class><Boolean>

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard
open fun getChoice(id: String): String?

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard
open fun getFilter(): FileFilter?

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard
open fun removeChoice(id: String)

This is deprecated since version 4.10.

Link copied to clipboard
open fun removeFilter(filter: FileFilter)

This is deprecated since version 4.10.

Link copied to clipboard
open fun removeShortcutFolder(folder: <Error class: unknown class>): <Error class: unknown class><Boolean>

This is deprecated since version 4.10.

Link copied to clipboard
open fun setAction(action: FileChooserAction)

This is deprecated since version 4.10.

Link copied to clipboard
open fun setChoice(id: String, option: String)

This is deprecated since version 4.10.

Link copied to clipboard
open fun setCreateFolders(createFolders: Boolean)

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard
open fun setCurrentName(name: String)

This is deprecated since version 4.10.

Link copied to clipboard
open fun setFile(file: <Error class: unknown class>): <Error class: unknown class><Boolean>

This is deprecated since version 4.10.

Link copied to clipboard
open fun setFilter(filter: FileFilter)

This is deprecated since version 4.10.

Link copied to clipboard
open fun setSelectMultiple(selectMultiple: Boolean)

This is deprecated since version 4.10.