ml) [ unselect_filename
](method.FileChooser.unselect_filename.html) [ unselect_uri
](method.FileChooser.unselect_uri.html)

#####  Properties

[ action ](property.FileChooser.action.html) [ create-folders
](property.FileChooser.create-folders.html) [ do-overwrite-confirmation
](property.FileChooser.do-overwrite-confirmation.html) [ extra-widget
](property.FileChooser.extra-widget.html) [ filter
](property.FileChooser.filter.html) [ local-only ](property.FileChooser.local-
only.html) [ preview-widget ](property.FileChooser.preview-widget.html) [
preview-widget-active ](property.FileChooser.preview-widget-active.html) [
select-multiple ](property.FileChooser.select-multiple.html) [ show-hidden
](property.FileChooser.show-hidden.html) [ use-preview-label
](property.FileChooser.use-preview-label.html)

#####  Signals

[ confirm-overwrite ](signal.FileChooser.confirm-overwrite.html) [ current-
folder-changed ](signal.FileChooser.current-folder-changed.html) [ file-
activated ](signal.FileChooser.file-activated.html) [ selection-changed
](signal.FileChooser.selection-changed.html) [ update-preview
](signal.FileChooser.update-preview.html)

Generated by [ gi-docgen ](https://gitlab.gnome.org/GNOME/gi-docgen) 2023.4

###  Interface

#  [ Gtk ](index.html) FileChooser

####  Description  [ [src]
](https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkfilechooser.c#L28
"go to source location")

    
    
    interface Gtk.FileChooser : GObject.Object

` GtkFileChooser ` is an interface that can be implemented by file selection
widgets. In  GTK  +, the main objects that implement this interface are `
GtkFileChooserWidget ` , ` GtkFileChooserDialog ` , and ` GtkFileChooserButton
` . 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 names either as filenames or as URIs. For URIs,
the normal escaping rules are applied if the  URI  contains non-  ASCII
characters. However, filenames are always returned in the character set
specified by the ` G_FILENAME_ENCODING ` environment variable. Please see the
GLib documentation for more details about this variable.

This means that while you can pass the result of `
gtk_file_chooser_get_filename() ` to ` g_open() ` or g_fopen(), you may not be
able to directly set it as the text of a ` GtkLabel ` widget unless you
convert it first to  UTF  -8, which all  GTK  \+ widgets expect. You should
use ` g_filename_to_utf8() ` to convert filenames into strings that can be
passed to  GTK  \+ widgets.

#  Adding a Preview Widget

You can add a custom preview widget to a file chooser and then get
notification about when the preview needs to be updated. To install a preview
widget, use gtk_file_chooser_set_preview_widget(). Then, connect to the `
GtkFileChooser::update-preview ` signal to get notified when you need to
update the contents of the preview.

Your callback should use ` gtk_file_chooser_get_preview_filename() ` to see
what needs previewing. Once you have generated the preview for the
corresponding file, y