gtk.FileChooserButtona button to launch a gtk.FileChooserDialog
(new in PyGTK 2.6)Synopsisgtk.FileChooserButtongtk.HBoxgtk.FileChooserButtontitlebackendNonegtk.FileChooserButtondialogget_titleset_titletitleget_width_charsset_width_charsn_charsget_focus_on_clickset_focus_on_clickfocus_on_clickAncestry+-- gobject.GObject
+-- gtk.Object
+-- gtk.Widget
+-- gtk.Container
+-- gtk.Box
+-- gtk.HBox
+-- gtk.FileChooserButton (implements gtk.FileChooser)Implemented Interfacesgtk.FileChooserButton
implements
gtk.Buildablegtk.FileChooserButton Propertiesgtk.FileChooser Propertiesgtk.Object Propertiesgtk.Widget Propertiesgtk.Container Propertiesgtk.Box Properties
"dialog"Write-Construct OnlyThe gtk.FileChooserDialog
associated with the button. Available in GTK+ 2.6."focus-on-click"Read-WriteIf True the gtk.FileChooserButton
button grabs focus when it is clicked with the mouse. Default
value: True. Available in GTK+
2.10."title"Read-WriteThe string to use as the title on the gtk.FileChooserDialog
associated with the button. Default value: "Select A
File". Available in GTK+ 2.6."width-chars"Read-WriteThe width of the entry and label inside the button, in
characters. Allowed values: >= -1. Default value:
-1. Available in GTK+ 2.6.
gtk.FileChooserButton Style Propertiesgtk.Widget Style Propertiesgtk.FileChooserButton Child Propertiesgtk.Box Child Propertiesgtk.FileChooserButton Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypesgtk.FileChooser Signal Prototypes"file-set"callbackfilechooserbuttonuser_param1...DescriptionThis widget is available in PyGTK 2.6 and above.The gtk.FileChooserButton
is a widget that lets the user select a file. It implements the gtk.FileChooser
interface. Visually, it is a file name with a button to bring up a gtk.FileChooserDialog. The
user can then use that dialog to change the file associated with that
button. This widget does not support setting the "select-multiple"
property to True. For example to create a gtk.FileChooserButton
and set the current folder to '/etc' use:
filechooserbutton = gtk.FileChooserButton('Select a File')
filechooserbutton.set_current_folder('/etc')
The gtk.FileChooserButton
supports the gtk.FILE_CHOOSER_ACTION_OPEN and
gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER actions of the
.The gtk.FileChooserButton
will ellipsize the label, and thus will thus request little horizontal
space. To give the button more space, you should call the gtk.Widget.size_request()
method, the set_width_chars()
method, or pack the button in such a way that other interface elements
give space to the widget.Constructorgtk.FileChooserButtongtk.FileChooserButtontitlebackendNonetitle :the title of the browse dialogbackend :the name of a file system backend or
NoneReturns :a new gtk.FileChooserButtonThis constructor is available in PyGTK 2.6 and above.Creates a new button widget that opens a gtk.FileChooserDialog
when clicked. The title of the gtk.FileChooserDialog
is specified by title. If
backend is specified it is the name of a file system
backend.gtk.FileChooserButtongtk.FileChooserButtondialogdialog :a gtk.FileChooserDialogReturns :a new gtk.FileChooserButtonThis constructor is available in PyGTK 2.6 and above.Creates a new button widget that opens a gtk.FileChooserDialog
specified by dialog when clicked.Methodsgtk.FileChooserButton.get_titleget_titleReturns :the title of the gtk.FileChooserDialogThis method is available in PyGTK 2.6 and above.The get_title() method returns the
value of the "title" property which contains the title of the associated
gtk.FileChooserDialog.gtk.FileChooserButton.set_titleset_titletitletitle :a string to use as the title of the associated
gtk.FileChooserDialog.This method is available in PyGTK 2.6 and above.The set_title() method sets the "title"
property to the value of title. The "title" property
contains the title string of the associated gtk.FileChooserDialog.gtk.FileChooserButton.get_width_charsget_width_charsReturns : :the width in characters of the
buttonThis method is available in PyGTK 2.6 and above.The get_width_chars() method returns
the value of the "width-characters" property which contains the number of
characters the button width should be set to.gtk.FileChooserButton.set_width_charsset_width_charsn_charsn_chars :the width in characters for the
buttonThis method is available in PyGTK 2.6 and above.The set_width_chars() method sets the
"width-chars" property to the value of n_chars. The
"width-chars" property contains the width in characters that the button
should be set to.gtk.FileChooserButton.get_focus_on_clickget_focus_on_clickReturns :True if the button grabs
focus when it is clicked with the mouse.This method is available in PyGTK 2.10 and above.The get_focus_on_click() method returns
the value of the "focus-on-click" property. If the return value is
True if the button grabs focus when it is clicked
with the mouse. See the set_focus_on_click()
method.gtk.FileChooserButton.set_focus_on_clickset_focus_on_clickfocus_on_clickfocus_on_click :If True, the button grabs
focus when clicked with the mouseThis method is available in PyGTK 2.10 and above.The set_focus_on_click() method sets
the "focus-on-click" property to the value of
focus_on_click. If
focus_on_click is True, the
button will grab focus when it is clicked with the mouse. Making
mouse clicks not grab focus is useful in places like toolbars where
you don't want the keyboard focus removed from the main area of the
application.SignalsThe "file-set" gtk.FileChooserButton Signalcallbackfilechooserbuttonuser_param1...filechooserbutton :the filechooserbutton that received the signaluser_param1 :the first user parameter (if any) specified with the
connect()
method... :additional user parameters (if any)This signal is available in GTK+ 2.12 and above.
The "file-set" signal is emitted when the user selects a file.
Note that this signal is only emitted when the user changes the file.