Gtk.FileChooserWidget

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget Gtk.FileChooser Gtk.FileChooser GObject.GInterface->Gtk.FileChooser GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.FileChooserWidget Gtk.FileChooserWidget Gtk.FileChooser->Gtk.FileChooserWidget Gtk.Widget->Gtk.FileChooserWidget

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.FileChooser (25)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (action)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.FileChooser (6)

Name

Type

Flags

Short Description

search-mode

bool

r/w

show-time

bool

r

subtitle

str

r

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

desktop-folder

Emitted when the user asks for it.

down-folder

Emitted when the user asks for it.

home-folder

Emitted when the user asks for it.

location-popup

Emitted when the user asks for it.

location-popup-on-paste

Emitted when the user asks for it.

location-toggle-popup

Emitted when the user asks for it.

places-shortcut

Emitted when the user asks for it.

quick-bookmark

Emitted when the user asks for it.

recent-shortcut

Emitted when the user asks for it.

search-shortcut

Emitted when the user asks for it.

show-hidden

Emitted when the user asks for it.

up-folder

Emitted when the user asks for it.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.FileChooserWidget(**kwargs)
Bases:

Gtk.Widget, Gtk.FileChooser

Abstract:

No

GtkFileChooserWidget is a widget for choosing files.

It exposes the [iface`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.

Deprecated since version 4.10: Direct use of GtkFileChooserWidget is deprecated

classmethod new(action)[source]
Parameters:

action (Gtk.FileChooserAction) – Open or save mode for the widget

Returns:

a new GtkFileChooserWidget

Return type:

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 since version 4.10: Direct use of GtkFileChooserWidget is deprecated

Signal Details

Gtk.FileChooserWidget.signals.desktop_folder(file_chooser_widget)
Signal Name:

desktop-folder

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.down_folder(file_chooser_widget)
Signal Name:

down-folder

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.home_folder(file_chooser_widget)
Signal Name:

home-folder

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.location_popup(file_chooser_widget, path)
Signal Name:

location-popup

Flags:

RUN_FIRST, ACTION

Parameters:
  • file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

  • path (str) – a string that gets put in the text entry for the file name

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.

Gtk.FileChooserWidget.signals.location_popup_on_paste(file_chooser_widget)
Signal Name:

location-popup-on-paste

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.location_toggle_popup(file_chooser_widget)
Signal Name:

location-toggle-popup

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.places_shortcut(file_chooser_widget)
Signal Name:

places-shortcut

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.quick_bookmark(file_chooser_widget, bookmark_index)
Signal Name:

quick-bookmark

Flags:

RUN_FIRST, ACTION

Parameters:
  • file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

  • bookmark_index (int) – the number of the bookmark to switch to

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.

Gtk.FileChooserWidget.signals.recent_shortcut(file_chooser_widget)
Signal Name:

recent-shortcut

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.search_shortcut(file_chooser_widget)
Signal Name:

search-shortcut

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.show_hidden(file_chooser_widget)
Signal Name:

show-hidden

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Gtk.FileChooserWidget.signals.up_folder(file_chooser_widget)
Signal Name:

up-folder

Flags:

RUN_FIRST, ACTION

Parameters:

file_chooser_widget (Gtk.FileChooserWidget) – The object which received the signal

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>.

Property Details

Gtk.FileChooserWidget.props.search_mode
Name:

search-mode

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Gtk.FileChooserWidget.props.show_time
Name:

show-time

Type:

bool

Default Value:

False

Flags:

READABLE

Whether to show the time.

New in version 4.10.

Gtk.FileChooserWidget.props.subtitle
Name:

subtitle

Type:

str

Default Value:

''

Flags:

READABLE