:right-sidebar: True FileChooserWidget =================================================================== .. currentmodule:: gi.repository.Gtk .. deprecated:: 4.10 Direct use of ``GtkFileChooserWidget`` is deprecated .. class:: FileChooserWidget(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget`, :class:`~gi.repository.Gtk.FileChooser` ``GtkFileChooserWidget`` is a widget for choosing files. It exposes the :obj:`~gi.repository.Gtk.FileChooser` interface, and you should use the methods of this interface to interact with the widget. CSS nodes --------- ``GtkFileChooserWidget`` has a single CSS node with name filechooser. Constructors ------------ .. rst-class:: interim-class .. class:: FileChooserWidget :no-index: .. classmethod:: new(action: ~gi.repository.Gtk.FileChooserAction) -> ~gi.repository.Gtk.Widget 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``. .. deprecated:: 4.10 Direct use of ``GtkFileChooserWidget`` is deprecated :param action: Open or save mode for the widget Properties ---------- .. rst-class:: interim-class .. class:: FileChooserWidget :no-index: .. attribute:: props.search_mode :type: bool .. attribute:: props.show_time :type: bool Whether to show the time. .. versionadded:: 4.10 .. attribute:: props.subtitle :type: str Signals ------- .. rst-class:: interim-class .. class:: FileChooserWidget.signals :no-index: .. method:: desktop_folder() -> None 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:`D`. .. method:: down_folder() -> None 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:`Down`. .. method:: home_folder() -> None 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:`Home`. .. method:: location_popup(path: str) -> None 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:`L` with a ``path`` string of "" (the empty string). It is also bound to / with a ``path`` string of "``/``" (a slash): this lets you type ``/`` and immediately type a path name. On Unix systems, this is bound to ~ (tilde) with a ``path`` string of "~" itself for access to home directories. :param path: a string that gets put in the text entry for the file name .. method:: location_popup_on_paste() -> None 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:`V`. .. method:: location_toggle_popup() -> None 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:`L`. .. method:: places_shortcut() -> None 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:`P`. .. method:: quick_bookmark(bookmark_index: int) -> None 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:`1`, :kbd:`Alt`-:kbd:`2`, etc. until :kbd:`Alt`-:kbd:`0`. Note that in the default binding, that :kbd:`Alt`-:kbd:`1` is actually defined to switch to the bookmark at index 0, and so on successively. :param bookmark_index: the number of the bookmark to switch to .. method:: recent_shortcut() -> None 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:`R`. .. method:: search_shortcut() -> None 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:`S`. .. method:: show_hidden() -> None 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:`H`. .. method:: up_folder() -> None 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:`Up`.