Gtk.FileChooserWidget¶
class — extends Widget, Accessible, Buildable, ConstraintTarget, FileChooser
:::warning Deprecated since 4.10 This API is deprecated. :::
GtkFileChooserWidget is a widget for choosing files.
It exposes the FileChooser interface, and you should
use the methods of this interface to interact with the
widget.
Shortcuts and Gestures¶
GtkFileChooserWidget supports the following keyboard shortcuts:
- <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
The following signals have default keybindings:
FileChooserWidget.desktop-folderFileChooserWidget.down-folderFileChooserWidget.home-folderFileChooserWidget.location-popupFileChooserWidget.location-popup-on-pasteFileChooserWidget.location-toggle-popupFileChooserWidget.places-shortcutFileChooserWidget.quick-bookmarkFileChooserWidget.recent-shortcutFileChooserWidget.search-shortcutFileChooserWidget.show-hiddenFileChooserWidget.up-folder
CSS nodes¶
GtkFileChooserWidget has a single CSS node with name filechooser.
Constructors¶
new¶
:::warning Deprecated since 4.10 This API is deprecated. :::
Creates a new GtkFileChooserWidget.
This is a file chooser widget that can be embedded in custom
windows, and it is the same widget that is used by
GtkFileChooserDialog.
Parameters:
action— Open or save mode for the widget
Properties¶
search_mode¶
Whether search mode is enabled.
show_time¶
Whether to show the time.
subtitle¶
The subtitle of the file chooser widget.
Signals¶
desktop-folder¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Alt</kbd>-<kbd>D</kbd>.
down-folder¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Alt</kbd>-<kbd>Down</kbd>.
home-folder¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Alt</kbd>-<kbd>Home</kbd>.
location-popup¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Control</kbd>-<kbd>L</kbd>
with a path string of "" (the empty string). It is also bound to
<kbd>/</kbd> with a path string of "/" (a slash): this lets you
type / and immediately type a path name. On Unix systems, this is
bound to <kbd>~</kbd> (tilde) with a path string of "~" itself for
access to home directories.
location-popup-on-paste¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Control</kbd>-<kbd>V</kbd>.
location-toggle-popup¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Control</kbd>-<kbd>L</kbd>.
places-shortcut¶
Emitted when the user asks for it.
This is a keybinding signal.
This is used to move the focus to the places sidebar.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>P</kbd>.
quick-bookmark¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Alt</kbd>-<kbd>1</kbd>, <kbd>Alt</kbd>-<kbd>2</kbd>, etc. until <kbd>Alt</kbd>-<kbd>0</kbd>. Note that in the default binding, that <kbd>Alt</kbd>-<kbd>1</kbd> is actually defined to switch to the bookmark at index 0, and so on successively.
recent-shortcut¶
Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the Recent location.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>R</kbd>.
search-shortcut¶
Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the search entry.
The default binding for this signal is <kbd>Alt</kbd>-<kbd>S</kbd>.
show-hidden¶
Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser display hidden files.
The default binding for this signal is <kbd>Control</kbd>-<kbd>H</kbd>.
up-folder¶
Emitted when the user asks for it.
This is a keybinding signal.
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 <kbd>Alt</kbd>-<kbd>Up</kbd>.