gtk.FileSelectiona dialog used to prompt the user for a file or directory
nameSynopsisgtk.FileSelectiongtk.Dialoggtk.FileSelectiontitleNoneset_filenamefilenameget_filenamecompletepatternshow_fileop_buttonshide_fileop_buttonsget_selectionsset_select_multipleselect_multipleget_select_multipleAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Container
+-- gtk.Bin
+-- gtk.Window
+-- gtk.Dialog
+-- gtk.FileSelection
Implemented Interfacesgtk.FileSelection
implements
gtk.Buildablegtk.FileSelection Propertiesgtk.Object Propertiesgtk.Widget Propertiesgtk.Container Propertiesgtk.Window Propertiesgtk.Dialog Properties
"filename"Read/WriteThe currently selected filename."select-multiple"Read/WriteIf True allow multiple files to be
selected."show-fileops"Read/WriteIf True display the buttons for creating
and manipulating files.
"dir_list"ReadThe gtk.TreeView
widget used to display the directories"file_list"ReadThe gtk.TreeView
widget used to display the files."selection_entry"ReadThe gtk.Entry widget used
to display the current file selection"selection_text"ReadThe gtk.Label associated
with the selection entry."main_vbox"ReadThe gtk.VBox widget that
holds all the widgets of the gtk.FileSelection
dialog."ok_button"ReadThe "OK" button."cancel_button"ReadThe "Cancel" button."history_pulldown"ReadThe gtk.OptionMenu
widget that provides the pulldown list of directory paths."history_menu"ReadThe gtk.Menu part of the
history_pulldown"fileop_dialog"ReadThe dialog box used to display the gtk.FileSelection.
It can be customized by adding or removing widgets from it using the
standard gtk.Dialog
methods."fileop_entry"ReadThe gtk.Entry in the
fileops dialog that is created when one of the fileops buttons is
clicked."fileop_file"ReadThe name of the file to be operated on by the
fileops"fileop_c_dir"ReadThe "New Folder" fileops button."fileop_del_file"ReadThe "Delete File" fileops button"fileop_ren_file"ReadThe "Rename File" fileops button"button_area"ReadThe fileops gtk.ButtonBox."action_area"ReadA gtk.HBox that can be
used by the application to add buttons, etc.
gtk.FileSelection Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypesgtk.Window Signal Prototypesgtk.Dialog Signal PrototypesDescriptionThe gtk.FileSelection is
deprecated and should not be used in newly-written code.The gtk.FileSelection
should be used to retrieve file or directory names from the user. It will
create a new dialog window containing a directory list, and a file list
corresponding to the current working directory. The filesystem can be
navigated using the directory list or the drop-down history menu.
Alternatively, the TAB key can be used to navigate using
filename completion - common in text based editors such as emacs and
jed.File selection dialogs are created with a call to the gtk.FileSelection()
constructor.The default filename can be set using the set_filename()
method and the selected filename retrieved using the get_filename()
method.Use the complete()
method to display files and directories that match a given pattern. This can
be used for example, to show only *.txt files, or only files beginning with
gtk*.Simple file operations; create directory, delete file, and rename
file, are available from buttons at the top of the dialog. These can be
hidden using the hide_fileop_buttons()
method and shown again using the show_fileop_buttons()
method.Constructorgtk.FileSelectiontitleNonetitle :the text to be used as the title of the
fileselection dialog.Returns :a new fileselection dialogCreates a new file selection dialog. By default it will contain
gtk.TreeViews
displaying the application's current working directory, and its file
listing. File operation buttons that allow the user to create a directory,
delete files and rename files, are also present.Methodsgtk.FileSelection.set_filenameset_filenamefilenamefilename :a string to set as the default file
name.The set_filename() method sets a
default path for the file requester. If filename
includes a directory path, then the fileselection will open with that path
as its current working directory.Note the encoding of filename is the
on-disk encoding, which may not be UTF-8.gtk.FileSelection.get_filenameget_filenameReturns :currently-selected filename in the on-disk
encodingThe get_filename() method returns the
selected filename in the on-disk encoding, which may or may not be the same
as that used by GTK (UTF-8). If no file is selected then the selected
directory path is returned.gtk.FileSelection.completecompletepatternpattern :a string containing a pattern which may or may
not match any filenames in the current directory.The complete() method will attempt to
match pattern to valid filenames or subdirectories in
the current directory. If a match can be made, the matched filename will
appear in the text entry field of the file selection dialog. If a partial
match can be made, the "Files" list will contain those file names which have
been partially matched, and the "Directories" list those directories which
have been partially matched.gtk.FileSelection.show_fileop_buttonsshow_fileop_buttonsThe show_fileop_buttons() method shows
the fileops buttons: "New Folder", "Delete File" and "Rename File".gtk.FileSelection.hide_fileop_buttonshide_fileop_buttonsThe hide_fileop_buttons() method hides
the fileops buttons: "New Folder", "Delete File" and "Rename File".gtk.FileSelection.get_selectionsget_selectionsReturns :a tuple containing the selected
files.The get_selections() method retrieves a
tuple containing the file selections the user has made in the file selection
dialog. The first file in the list is equivalent to what the get_filename()
method would return.gtk.FileSelection.set_select_multipleset_select_multipleselect_multipleselect_multiple :If True the user is allowed
to select multiple files in the file list.The set_select_multiple() method sets
the file list selection mode according to the value of
select_multiple. If
select_multiple is True the user
is allowed to select multiple files in the file list. Use the get_selections()
method to retrieve the list of selected files.gtk.FileSelection.get_select_multipleget_select_multipleReturns :True if the user is allowed
to select multiple files in the file listThe get_select_multiple() method
determines whether the user is allowed to make multiple file selection in
the file list. If the get_select_multiple() method
returns True the user is allowed to select multiple files
in the file list. See the set_select_multiple()
method.