Import line: | Gtk = imports.gi.Gtk; |
GIR File: | Gtk-2.0.gir |
C documentation: | GtkFileChooser |
Interface : | FileChooser |
Implementations: | Gtk.FileChooserButton, Gtk.FileChooserDialog, Gtk.FileChooserWidget |
Show / Hide Inherited methods, properties and signals |
Properties | Defined By | |
---|---|---|
action : Gtk.FileChooserAction
|
Gtk.FileChooser | |
create_folders : Boolean
Whether a file chooser not in GTK_FILE_CHOOSER_ACTION_OPEN mode will offer the user to create new folders.
Whether a file chooser not in GTK_FILE_CHOOSER_ACTION_OPEN mode will offer the user to create new folders.
|
Gtk.FileChooser | |
do_overwrite_confirmation : Boolean
Whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present an overwrite confirmation dialog if the user selects a file name that already exists.
Whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present an overwrite confirmation dialog if the user selects a file name that already exists.
|
Gtk.FileChooser | |
extra_widget : Gtk.Widget
|
Gtk.FileChooser | |
file_system_backend : String
|
Gtk.FileChooser | |
filter : Gtk.FileFilter
|
Gtk.FileChooser | |
local_only : Boolean
|
Gtk.FileChooser | |
preview_widget : Gtk.Widget
|
Gtk.FileChooser | |
preview_widget_active : Boolean
|
Gtk.FileChooser | |
select_multiple : Boolean
|
Gtk.FileChooser | |
show_hidden : Boolean
|
Gtk.FileChooser | |
use_preview_label : Boolean
|
Gtk.FileChooser |
Method / Constructor | Defined By | |
---|---|---|
add_filter
(FileFilter filter)
:
none
Adds filter to the list of filters that the user can select between.
Adds filter to the list of filters that the user can select between. When a filter is selected, only files that are passed by that filter are displayed. Note that the chooser takes ownership of the filter, so you have to ref and sink it if you want to keep a reference.
|
Gtk.FileChooser | |
Adds a folder to be displayed with the shortcut folders in a file chooser.
Adds a folder to be displayed with the shortcut folders in a file chooser. Note that shortcut folders do not get saved, as they are provided by the application. For example, you can use this to add a "/usr/share/mydrawprogram/Clipart" folder to the volume list. otherwise. In the latter case, the error will be set as appropriate.
|
Gtk.FileChooser | |
Adds a folder URI to be displayed with the shortcut folders in a file chooser.
Adds a folder URI to be displayed with the shortcut folders in a file chooser. Note that shortcut folders do not get saved, as they are provided by the application. For example, you can use this to add a "file:///usr/share/mydrawprogram/Clipart" folder to the volume list. otherwise. In the latter case, the error will be set as appropriate.
|
Gtk.FileChooser | |
get_action
()
:
Gtk.FileChooserAction
Gets the type of operation that the file chooser is performing; see gtk_file_chooser_set_action().
Gets the type of operation that the file chooser is performing; see gtk_file_chooser_set_action().
|
Gtk.FileChooser | |
get_create_folders
()
:
Boolean
Gets whether file choser will offer to create new folders.
Gets whether file choser will offer to create new folders. See gtk_file_chooser_set_create_folders().
|
Gtk.FileChooser | |
get_current_folder
()
:
String
Gets the current folder of chooser as a local filename.
Gets the current folder of chooser as a local filename. See gtk_file_chooser_set_current_folder(). Note that this is the folder that the file chooser is currently displaying (e.g. "/home/username/Documents"), which is
|
Gtk.FileChooser | |
get_current_folder_file
()
:
Gio.File
Gets the current folder of chooser as GFile.
Gets the current folder of chooser as GFile. See gtk_file_chooser_get_current_folder_uri().
|
Gtk.FileChooser | |
get_current_folder_uri
()
:
String
Gets the current folder of chooser as an URI.
Gets the current folder of chooser as an URI. See gtk_file_chooser_set_current_folder_uri(). Note that this is the folder that the file chooser is currently displaying (e.g. "file:///home/username/Documents"), which is
|
Gtk.FileChooser | |
get_do_overwrite_confirmation
()
:
Boolean
Queries whether a file chooser is set to confirm for overwriting when the user types a file name that already exists.
Queries whether a file chooser is set to confirm for overwriting when the user types a file name that already exists. FALSE otherwise.
|
Gtk.FileChooser | |
get_extra_widget
()
:
Gtk.Widget
Gets the current preview widget; see gtk_file_chooser_set_extra_widget().
Gets the current preview widget; see gtk_file_chooser_set_extra_widget().
|
Gtk.FileChooser | |
get_file
()
:
Gio.File
Gets the GFile for the currently selected file in the file selector.
Gets the GFile for the currently selected file in the file selector. If multiple files are selected, one of the files will be returned at random. If the file chooser is in folder mode, this function returns the selected folder. g_object_unref() to release it.
|
Gtk.FileChooser | |
get_filename
()
:
String
Gets the filename for the currently selected file in the file selector.
Gets the filename for the currently selected file in the file selector. If multiple files are selected, one of the filenames will be returned at random. If the file chooser is in folder mode, this function returns the selected folder. if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
|
Gtk.FileChooser | |
get_filenames
()
:
Array
Lists all the selected files and subfolders in the current folder of folder cannot be represented as local filenames they will be ignored.
Lists all the selected files and subfolders in the current folder of folder cannot be represented as local filenames they will be ignored. (See gtk_file_chooser_get_uris()) files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
|
Gtk.FileChooser | |
get_files
()
:
Array
Lists all the selected files and subfolders in the current folder of chooser as GFile.
Lists all the selected files and subfolders in the current folder of chooser as GFile. An internal function, see gtk_file_chooser_get_uris(). file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
|
Gtk.FileChooser | |
get_filter
()
:
Gtk.FileFilter
Gets the current filter; see gtk_file_chooser_set_filter().
Gets the current filter; see gtk_file_chooser_set_filter().
|
Gtk.FileChooser | |
get_local_only
()
:
Boolean
Gets whether only local files can be selected in the file selector.
Gets whether only local files can be selected in the file selector. See gtk_file_chooser_set_local_only()
|
Gtk.FileChooser | |
get_preview_file
()
:
Gio.File
Gets the GFile that should be previewed in a custom preview Internal function, see gtk_file_chooser_get_preview_uri().
Gets the GFile that should be previewed in a custom preview Internal function, see gtk_file_chooser_get_preview_uri(). is selected. Free with g_object_unref().
|
Gtk.FileChooser | |
get_preview_filename
()
:
String
Gets the filename that should be previewed in a custom preview widget.
Gets the filename that should be previewed in a custom preview widget. See gtk_file_chooser_set_preview_widget(). is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
|
Gtk.FileChooser | |
get_preview_uri
()
:
String
Gets the URI that should be previewed in a custom preview widget.
Gets the URI that should be previewed in a custom preview widget. See gtk_file_chooser_set_preview_widget(). selected. Free with g_free().
|
Gtk.FileChooser | |
get_preview_widget
()
:
Gtk.Widget
Gets the current preview widget; see gtk_file_chooser_set_preview_widget().
Gets the current preview widget; see gtk_file_chooser_set_preview_widget().
|
Gtk.FileChooser | |
get_preview_widget_active
()
:
Boolean
Gets whether the preview widget set by gtk_file_chooser_set_preview_widget() should be shown for the current filename.
Gets whether the preview widget set by gtk_file_chooser_set_preview_widget() should be shown for the current filename. See gtk_file_chooser_set_preview_widget_active().
|
Gtk.FileChooser | |
get_select_multiple
()
:
Boolean
Gets whether multiple files can be selected in the file selector.
Gets whether multiple files can be selected in the file selector. See gtk_file_chooser_set_select_multiple().
|
Gtk.FileChooser | |
get_show_hidden
()
:
Boolean
Gets whether hidden files and folders are displayed in the file selector.
Gets whether hidden files and folders are displayed in the file selector. See gtk_file_chooser_set_show_hidden().
|
Gtk.FileChooser | |
get_uri
()
:
String
Gets the URI for the currently selected file in the file selector.
Gets the URI for the currently selected file in the file selector. If multiple files are selected, one of the filenames will be returned at random. If the file chooser is in folder mode, this function returns the selected folder. if no file is selected. Free with g_free()
|
Gtk.FileChooser | |
get_uris
()
:
Array
Lists all the selected files and subfolders in the current folder of files and subfolders in the current folder.
Lists all the selected files and subfolders in the current folder of files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
|
Gtk.FileChooser | |
get_use_preview_label
()
:
Boolean
Gets whether a stock label should be drawn with the name of the previewed file.
Gets whether a stock label should be drawn with the name of the previewed file. See gtk_file_chooser_set_use_preview_label(). name of the previewed file, FALSE otherwise.
|
Gtk.FileChooser | |
list_filters
()
:
Array
Lists the current set of user-selectable filters; see gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
Lists the current set of user-selectable filters; see gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter(). user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
|
Gtk.FileChooser | |
list_shortcut_folder_uris
()
:
Array
Queries the list of shortcut folders in the file chooser, as set by gtk_file_chooser_add_shortcut_folder_uri().
Queries the list of shortcut folders in the file chooser, as set by gtk_file_chooser_add_shortcut_folder_uri(). folders. Free the returned list with g_slist_free(), and the URIs with g_free().
|
Gtk.FileChooser | |
list_shortcut_folders
()
:
Array
Queries the list of shortcut folders in the file chooser, as set by gtk_file_chooser_add_shortcut_folder().
Queries the list of shortcut folders in the file chooser, as set by gtk_file_chooser_add_shortcut_folder(). folders. Free the returned list with g_slist_free(), and the filenames with g_free().
|
Gtk.FileChooser | |
remove_filter
(FileFilter filter)
:
none
Removes filter from the list of filters that the user can select between.
Removes filter from the list of filters that the user can select between.
|
Gtk.FileChooser | |
Gtk.FileChooser | ||
Gtk.FileChooser | ||
select_all
()
:
none
Selects all the files in the current folder of a file chooser.
Selects all the files in the current folder of a file chooser.
|
Gtk.FileChooser | |
Gtk.FileChooser | ||
Gtk.FileChooser | ||
Gtk.FileChooser | ||
set_action
(FileChooserAction action)
:
none
Sets the type of operation that the chooser is performing; the user interface is adapted to suit the selected action.
Sets the type of operation that the chooser is performing; the user interface is adapted to suit the selected action. For example, an option to create a new folder might be shown if the action is GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is GTK_FILE_CHOOSER_ACTION_OPEN.
|
Gtk.FileChooser | |
set_create_folders
(Boolean create_folders)
:
none
Sets whether file choser will offer to create new folders.
Sets whether file choser will offer to create new folders. This is only relevant if the action is not set to be GTK_FILE_CHOOSER_ACTION_OPEN.
|
Gtk.FileChooser | |
Sets the current folder for chooser from a local filename.
|
Gtk.FileChooser | |
Gtk.FileChooser | ||
Gtk.FileChooser | ||
set_current_name
(String name)
:
none
Sets the current name in the file selector, as if entered by the user.
Sets the current name in the file selector, as if entered by the user. Note that the name passed in here is a UTF-8 string rather than a filename. This function is meant for such uses as a suggested name in a "Save As..." dialog. If you want to preselect a particular existing file, you should use gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead. Please see the documentation for those functions for an example of using gtk_file_chooser_set_current_name() as well.
|
Gtk.FileChooser | |
set_do_overwrite_confirmation
(Boolean do_overwrite_confirmation)
:
none
Sets whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present a confirmation dialog if the user types a file name that already exists.
Sets whether a file chooser in GTK_FILE_CHOOSER_ACTION_SAVE mode will present a confirmation dialog if the user types a file name that already exists. This is FALSE by default. Regardless of this setting, the chooser will emit the GtkFileChooser::confirm-overwrite signal when appropriate. If all you need is the stock confirmation dialog, set this property to TRUE. You can override the way confirmation is done by actually handling the GtkFileChooser::confirm-overwrite signal; please refer to its documentation for the details.
|
Gtk.FileChooser | |
set_extra_widget
(Widget extra_widget)
:
none
Sets an application-supplied widget to provide extra options to the user.
Sets an application-supplied widget to provide extra options to the user.
|
Gtk.FileChooser | |
Sets file as the current filename for the file chooser, by changing to the file's parent folder and actually selecting the file in list.
Sets file as the current filename for the file chooser, by changing to the file's parent folder and actually selecting the file in list. If the chooser is in GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name will also appear in the dialog's file name entry. If the file name isn't in the current folder of chooser, then the current folder of chooser will be changed to the folder containing filename. This is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by gtk_file_chooser_select_filename(). Note that the file must exist, or nothing will be done except for the directory change. If you are implementing a
|
Gtk.FileChooser | |
Sets filename as the current filename for the file chooser, by changing to the file's parent folder and actually selecting the file in list.
Sets filename as the current filename for the file chooser, by changing to the file's parent folder and actually selecting the file in list. If the chooser is in GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name will also appear in the dialog's file name entry. If the file name isn't in the current folder of chooser, then the current folder of chooser will be changed to the folder containing filename. This is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by gtk_file_chooser_select_filename(). Note that the file must exist, or nothing will be done except for the directory change. If you are implementing a
|
Gtk.FileChooser | |
set_filter
(FileFilter filter)
:
none
Sets the current filter; only the files that pass the filter will be displayed.
Sets the current filter; only the files that pass the filter will be displayed. If the user-selectable list of filters is non-empty, then the filter should be one of the filters in that list. Setting the current filter when the list of filters is empty is useful if you want to restrict the displayed set of files without letting the user change it.
|
Gtk.FileChooser | |
set_local_only
(Boolean local_only)
:
none
Sets whether only local files can be selected in the file selector.
Sets whether only local files can be selected in the file selector. If local_only is TRUE (the default), then the selected file are files are guaranteed to be accessible through the operating systems native file file system and therefore the application only needs to worry about the filename functions in GtkFileChooser, like gtk_file_chooser_get_filename(), rather than the URI functions like gtk_file_chooser_get_uri(),
|
Gtk.FileChooser | |
set_preview_widget
(Widget preview_widget)
:
none
Sets an application-supplied widget to use to display a custom preview of the currently selected file.
Sets an application-supplied widget to use to display a custom preview of the currently selected file. To implement a preview, after setting the preview widget, you connect to the GtkFileChooser::update-preview signal, and call gtk_file_chooser_get_preview_filename() or gtk_file_chooser_get_preview_uri() on each change. If you can display a preview of the new file, update your widget and set the preview active using gtk_file_chooser_set_preview_widget_active(). Otherwise, set the preview inactive. When there is no application-supplied preview widget, or the application-supplied preview widget is not active, the file chooser may display an internally generated preview of the current file or it may display no preview at all.
|
Gtk.FileChooser | |
set_preview_widget_active
(Boolean active)
:
none
Sets whether the preview widget set by gtk_file_chooser_set_preview_widget() should be shown for the current filename.
Sets whether the preview widget set by gtk_file_chooser_set_preview_widget() should be shown for the current filename. When active is set to false, the file chooser may display an internally generated preview of the current file or it may display no preview at all. See gtk_file_chooser_set_preview_widget() for more details.
|
Gtk.FileChooser | |
set_select_multiple
(Boolean select_multiple)
:
none
Sets whether multiple files can be selected in the file selector.
Sets whether multiple files can be selected in the file selector. This is only relevant if the action is set to be GTK_FILE_CHOOSER_ACTION_OPEN or GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
|
Gtk.FileChooser | |
set_show_hidden
(Boolean show_hidden)
:
none
Sets whether hidden files and folders are displayed in the file selector.
Sets whether hidden files and folders are displayed in the file selector.
|
Gtk.FileChooser | |
Sets the file referred to by uri as the current file for the file chooser, by changing to the URI's parent folder and actually selecting the URI in the list.
Sets the file referred to by uri as the current file for the file chooser, by changing to the URI's parent folder and actually selecting the URI in the list. If the chooser is GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI's base name will also appear in the dialog's file name entry. If the URI isn't in the current folder of chooser, then the current folder of chooser will be changed to the folder containing uri. This is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by gtk_file_chooser_select_uri(). Note that the URI must exist, or nothing will be done except for the directory change. If you are implementing a
|
Gtk.FileChooser | |
set_use_preview_label
(Boolean use_label)
:
none
Sets whether the file chooser should display a stock label with the name of the file that is being previewed; the default is TRUE.
Sets whether the file chooser should display a stock label with the name of the file that is being previewed; the default is TRUE. Applications that want to draw the whole preview area themselves should set this to FALSE and display the name themselves in their preview widget.
|
Gtk.FileChooser | |
unselect_all
()
:
none
Unselects all the files in the current folder of a file chooser.
Unselects all the files in the current folder of a file chooser.
|
Gtk.FileChooser | |
unselect_file
(File file)
:
none
Unselects the file referred to by file.
Unselects the file referred to by file. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing.
|
Gtk.FileChooser | |
unselect_filename
(String filename)
:
none
Unselects a currently selected filename.
Unselects a currently selected filename. If the filename is not in the current directory, does not exist, or is otherwise not currently selected, does nothing.
|
Gtk.FileChooser | |
unselect_uri
(String uri)
:
none
Unselects the file referred to by uri.
Unselects the file referred to by uri. If the file is not in the current directory, does not exist, or is otherwise not currently selected, does nothing.
|
Gtk.FileChooser |
Event | Defined By | |
---|---|---|
confirm_overwrite (FileChooser self)
:
Gtk.FileChooserConfirmation
This signal gets emitted whenever it is appropriate to present a confirmation dialog when the user has selected a file name that already exists.
This signal gets emitted whenever it is appropriate to present a confirmation dialog when the user has selected a file name that already exists. The signal only gets emitted when the file chooser is in GTK_FILE_CHOOSER_ACTION_SAVE mode. Most applications just need to turn on the GtkFileChooser:do-overwrite-confirmation property (or call the gtk_file_chooser_set_do_overwrite_confirmation() function), and they will automatically get a stock confirmation dialog. Applications which need to customize this behavior should do that, and also connect to the GtkFileChooser::confirm-overwrite signal. A signal handler for this signal must return a GtkFileChooserConfirmation value, which indicates the action to take. If the handler determines that the user wants to select a different filename, it should return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN. If it determines that the user is satisfied with his choice of file name, it should return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME. On the other hand, if it determines that the stock confirmation dialog should be used, it should return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM. The following example illustrates this.
|
Gtk.FileChooser | |
current_folder_changed (FileChooser self)
:
none
|
Gtk.FileChooser | |
file_activated (FileChooser self)
:
none
|
Gtk.FileChooser | |
selection_changed (FileChooser self)
:
none
|
Gtk.FileChooser | |
update_preview (FileChooser self)
:
none
|
Gtk.FileChooser |
Class / Namespace | Method / Signal / Properties |
---|---|
Gtk.FileChooserButton
Property |
dialog : Gtk.FileChooser
Instance of the GtkFileChooserDialog associated with the button.
|