<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="class-gtkfilechooser">
  <refnamediv>
    <refname>gtk.FileChooser</refname>
    <refpurpose>an interface for choosing files used by <link
    linkend="class-gtkfilechooserwidget"><classname>gtk.FileChooserWidget</classname></link>
    and <link
    linkend="class-gtkfilechooserdialog"><classname>gtk.FileChooserDialog</classname></link>
    (new in PyGTK 2.4)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.FileChooser</classname></ooclass>
      <ooclass><classname>gobject.GInterface</classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-action">set_action</link></methodname>
	<methodparam><parameter role="keyword">action</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-action">get_action</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-local-only">set_local_only</link></methodname>
	<methodparam><parameter role="keyword">local_only</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-local-only">get_local_only</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-select-multiple">set_select_multiple</link></methodname>
	<methodparam><parameter role="keyword">select_multiple</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-select-multiple">get_select_multiple</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-current-name">set_current_name</link></methodname>
	<methodparam><parameter role="keyword">name</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-filename">get_filename</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-filename">set_filename</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--select-filename">select_filename</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--unselect-filename">unselect_filename</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--select-all">select_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--unselect-all">unselect_all</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-filenames">get_filenames</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-current-folder">set_current_folder</link></methodname>
	<methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-current-folder">get_current_folder</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-uri">get_uri</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-uri">set_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--select-uri">select_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--unselect-uri">unselect_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-uris">get_uris</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-current-folder-uri">set_current_folder_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-current-folder-uri">get_current_folder_uri</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-preview-widget">set_preview_widget</link></methodname>
	<methodparam><parameter role="keyword">preview_widget</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-preview-widget">get_preview_widget</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-preview-widget-active">set_preview_widget_active</link></methodname>
	<methodparam><parameter role="keyword">active</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-preview-widget-active">get_preview_widget_active</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-use-preview-label">set_use_preview_label</link></methodname>
	<methodparam><parameter role="keyword">use_label</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-use-preview-label">get_use_preview_label</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-preview-filename">get_preview_filename</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-preview-uri">get_preview_uri</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-extra-widget">set_extra_widget</link></methodname>
	<methodparam><parameter role="keyword">extra_widget</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-extra-widget">get_extra_widget</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--add-filter">add_filter</link></methodname>
	<methodparam><parameter role="keyword">filter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--remove-filter">remove_filter</link></methodname>
	<methodparam><parameter role="keyword">filter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--list-filters">list_filters</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-filter">set_filter</link></methodname>
	<methodparam><parameter role="keyword">filter</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-filter">get_filter</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--add-shortcut-folder">add_shortcut_folder</link></methodname>
	<methodparam><parameter role="keyword">folder</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--remove-shortcut-folder">remove_shortcut_folder</link></methodname>
	<methodparam><parameter role="keyword">folder</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--list-shortcut-folders">list_shortcut_folders</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--add-shortcut-folder-uri">add_shortcut_folder_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--remove-shortcut-folder-uri">remove_shortcut_folder_uri</link></methodname>
	<methodparam><parameter role="keyword">uri</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--list-shortcut-folder-uris">list_shortcut_folder_uris</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-show-hidden">set_show_hidden</link></methodname>
	<methodparam><parameter role="keyword">show_hidden</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-show-hidden">get_show_hidden</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-do-overwrite-confirmation">set_do_overwrite_confirmation</link></methodname>
	<methodparam><parameter role="keyword">do_overwrite_confirmation</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-do-overwrite-confirmation">get_do_overwrite_confirmation</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-current-folder-file">get_current_folder_file</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-file">get_file</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>

      <!-- NOT IMPLEMENTED
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser- -get-files">get_files</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      -->

      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--get-preview-file">get_preview_file</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--select-file">select_file</link></methodname>
	<methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-current-folder-file">set_current_folder_file</link></methodname>
	<methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--set-file">set_file</link></methodname>
	<methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gtkfilechooser--unselect-file">unselect_file</link></methodname>
	<methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1 id="properties-gtkfilechooser">
    <title>gtk.FileChooser Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"action"</entry>
	      <entry>Read-Write</entry>
	      <entry>The type of operation that the file selector is
	      performing - one of the <xref
	      linkend="gtk-filechooser-action-constants"
	      endterm="gtk-filechooser-action-constants-title"></xref>. Default
	      value: <literal>gtk.FILE_CHOOSER_ACTION_OPEN</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"do-overwrite-confirmation"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal> a file chooser in
	      <literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal> will present
	      an overwrite confirmation dialog if the user selects a file
	      name that already exists. Default value:
	      <literal>False</literal>. This property is available in GTK+
	      2.8 and above</entry>
	    </row>

	    <row valign="top">
	      <entry>"extra-widget"</entry>
	      <entry>Read-Write</entry>
	      <entry>An application supplied widget for extra options.</entry>
	    </row>

	    <row valign="top">
	      <entry>"file-system-backend"</entry>
	      <entry>Write-Construct</entry>
	      <entry>The name of the file system backend to use.
Default value: <literal>None</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"filter"</entry>
	      <entry>Read-Write</entry>
	      <entry>The current <link
linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link>
for selecting which files are displayed.</entry>
	    </row>

	    <row valign="top">
	      <entry>"local-only"</entry>
	      <entry>Read-Write</entry>

	      <entry>If <literal>True</literal>, the selected file(s) should
be limited to local file: URLs. Default value: <literal>True</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"preview-widget"</entry>
	      <entry>Read-Write</entry>
	      <entry>An application supplied widget for custom
previews.</entry>
	    </row>

	    <row valign="top">
	      <entry>"preview-widget-active"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, the application supplied
widget for custom previews should be shown. Default value:
<literal>True</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"select-multiple"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, allow multiple files to be
	      selected except if
	      <literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal> is set as the
	      "action" property. Default value:
<literal>False</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"show-hidden"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, hidden files and folders
should be displayed. Default value: <literal>False</literal></entry>
	    </row>

	    <row valign="top">
	      <entry>"use-preview-label"</entry>
	      <entry>Read-Write</entry>
	      <entry>If <literal>True</literal>, display a stock label with
the name of the previewed file. Default value: <literal>True</literal></entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkfilechooser">
    <title>gtk.FileChooser Signal Prototypes</title>

    <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtkfilechooser--confirm-overwrite">confirm-overwrite</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>filechooser</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkfilechooser--current-folder-changed">current-folder-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>filechooser</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkfilechooser--file-activated">file-activated</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>filechooser</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkfilechooser--selection-changed">selection-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>filechooser</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkfilechooser--update-preview">update-preview</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>filechooser</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <note>
      <para>This interface is available in PyGTK 2.4 and above.</para>
    </note>

    <para><link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>
is an interface that can be implemented by file selection widgets. In PyGTK,
the main objects that implement this interface are <link
linkend="class-gtkfilechooserwidget"><classname>gtk.FileChooserWidget</classname></link>
and <link
linkend="class-gtkfilechooserdialog"><classname>gtk.FileChooserDialog</classname></link>. You
do not need to write an object that implements the <link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>
interface unless you are trying to adapt an existing file selector to expose
a standard programming interface.</para>

    <para><link
    linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>
    has several elements to its display:</para>

    <itemizedlist>
      <listitem>
	<simpara>a list of shortcut folders on the left that is divided into
two lists by a horizontal line:</simpara>
	<itemizedlist>
	  <listitem>
	    <simpara>a default list of folders usually including "Home" and
"Filesystem" with folders added using the <link
linkend="method-gtkfilechooser--add-shortcut-folder"><methodname>add_shortcut_folder</methodname>()</link>
or <link
linkend="method-gtkfilechooser--add-shortcut-folder-uri"><methodname>add_shortcut_folder_uri</methodname>()</link>
methods.</simpara>
	  </listitem>
	  <listitem>
	    <simpara>a list of user specified shortcut folders managed using
the "Add" and "Remove" buttons at the bottom of the file chooser.</simpara>
	  </listitem>
	</itemizedlist>
      </listitem>
      <listitem>
	<simpara>the "Add" and "Remove" buttons that allow a user to add or
remove a folder to or from the user's shortcut folder list.</simpara>
      </listitem>
      <listitem>
	<simpara>the current folder path as a series of buttons above the
file selection window. The buttons can be clicked to jump to the associated
ancestor folder.</simpara>
      </listitem>
      <listitem>
	<simpara>the file selection window that displays the contents of the
current folder in alphabetical order with last modified time.</simpara>
      </listitem>
   </itemizedlist>

    <refsect2 id="FileNamesAndEncodings">
      <title>File Names and Encodings</title>

      <para>When the user is finished selecting files in a <link
      linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>,
      your program can get the selected names either as filenames or as
      URIs. For URIs, the normal escaping rules are applied if the URI
      contains non-ASCII characters. However, filenames are always returned
      in the character set specified by the result of calling the Python
      sys.getfilesystemencoding() function. On POSIX this is the actual
      on-disk encoding which might correspond to the locale settings of the
      process, or not. On Windows the file name encoding is UTF-8. Note that
      the Microsoft C library does not use UTF-8, but has separate APIs for
      current system code page and wide characters (UTF-16).</para>

      <important>
        <para>This means that while you can pass the result of <link
        linkend="method-gtkfilechooser--get-filename"><methodname>get_filename</methodname>()</link>
        to open() or os.open(), you may not be able to directly set it as
        the text of a <link
        linkend="class-gtklabel"><classname>gtk.Label</classname></link>
        widget unless you convert it first to UTF-8, which all PyGTK widgets
        expect. If necessary you should use the Python codecs to convert
        filenames into strings that can be passed to PyGTK widgets.</para>
      </important>

    </refsect2>

    <refsect2 id="AddingAPreviewWidget">
      <title>Adding A Preview Widget</title>

      <para>You can add a custom preview widget to a file chooser and get
notification when the preview needs to be updated. To install a preview
widget, use the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget</methodname>()</link>
method. Then, connect to the "update-preview" signal to be notified when
you need to update the contents of the preview.</para>

      <para>Your callback should use the <link
linkend="method-gtkfilechooser--get-preview-filename"><methodname>get_preview_filename</methodname>()</link>
method to see what needs previewing. Once you have generated the preview for
the corresponding file, you must call the <link
linkend="method-gtkfilechooser--set-preview-widget-active"><methodname>set_preview_widget_active</methodname>()</link>
method with a boolean flag that indicates whether your callback could
successfully generate a preview. An example use of a custom preview
is:</para>

    <programlisting>
    ...
    preview = gtk.Image()

    my_file_chooser.set_preview_widget(preview)
    my_file_chooser.connect("update-preview", update_preview_cb, preview)
    ...

  def update_preview_cb(file_chooser, preview):
    filename = file_chooser.get_preview_filename()
    try:
      pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename, 128, 128)
      preview.set_from_pixbuf(pixbuf)
      have_preview = True
    except:
      have_preview = False
    file_chooser.set_preview_widget_active(have_preview)
    return
  ...
</programlisting>
    </refsect2>

    <refsect2>
      <title>Adding Extra Widgets</title>

      <para> You can add extra widgets to a file chooser to provide options
that are not present in the default design. For example, you can add a <link
linkend="class-gtktogglebutton"><classname>gtk.ToggleButton</classname></link>
to give the user the option to open a file in read-only mode. You can use
the <link
linkend="method-gtkfilechooser--set-extra-widget"><methodname>set_extra_widget</methodname>()</link>
method to insert additional widgets in a file chooser. For example:</para>

      <programlisting>
  toggle = gtk.CheckButton("Open file read-only")
  toggle.show ()
  my_file_chooser.set_extra_widget(toggle)
</programlisting>

      <para> If you want to set more than one extra widget in the file
chooser, you can use a container such as a <link
linkend="class-gtkvbox"><classname>gtk.VBox</classname></link> or a <link
linkend="class-gtktable"><classname>gtk.Table</classname></link> to hold
your widgets; then set the container as the whole extra widget.</para>

    </refsect2>

    <refsect2>
      <title>Key Bindings</title>

      <para>The <link
linkend="class-gtkfilechooserdialog"><classname>gtk.FileChooserDialog</classname></link>
uses the private <classname>GtkFileChooserDefaultClass</classname> that has
several key bindings and their associated signals. This section describes
the available key binding signals.</para>

      <para>The default keys that activate the key-binding signals in GtkFileChooserDefaultClass are as follows:</para>

      <informaltable pgwide="1" frame="none">
        <tgroup cols="2">
          <colspec column="1" colwidth="2in"/>
          <colspec column="2" colwidth="2in"/>
          <thead>
            <row>
              <entry>Signal name</entry>
              <entry>Key</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>location-popup</entry>
              <entry>Control-L</entry>
            </row>
            <row>
              <entry>up-folder</entry>
              <entry>Alt-Up</entry>
            </row>
            <row>
              <entry>down-folder</entry>
              <entry>Alt-Down</entry>
            </row>
            <row>
              <entry>home-folder</entry>
              <entry>Alt-Home</entry>
            </row>
          </tbody>
          </tgroup>
      </informaltable>

      <para>To change these defaults to something else, you could include
the following fragment in your <filename>.gtkrc-2.0</filename> file:</para>

      <programlisting>
  binding "my-own-gtkfilechooser-bindings" {
	bind "&lt;Alt&gt;&lt;Shift&gt;l" {
		"location-popup" ()
	}
	bind "&lt;Alt&gt;&lt;Shift&gt;Up" {
		"up-folder" ()
	}
	bind "&lt;Alt&gt;&lt;Shift&gt;Down" {
		"down-folder" ()
	}
	bind "&lt;Alt&gt;&lt;Shift&gt;Home" {
		"home-folder-folder" ()
	}
  }

  class "GtkFileChooserDefault" binding "my-own-gtkfilechooser-bindings"
</programlisting>

      <para>The "GtkFileChooserDefault::location-popup" signal is used to
make the file chooser show a "Location" dialog which the user can use to
manually type the name of the file he wishes to select. By default this is
bound to
<keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>.</para>

      <programlisting>
  def location_popup_cb(filechooser, user_data):
</programlisting>

      <para>where <parameter>filechooser</parameter> is the <link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>
that received the signal, <parameter>user_data</parameter> is user data set
when the signal handler was connected.</para>

      <para>The "GtkFileChooserDefault::up-folder" signal is used to make
the file chooser go to the parent of the current folder in the file
hierarchy. By default this is bound to
<keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>.</para>

      <programlisting>
  def up_folder_cb(filechooser, user_data):
</programlisting>

      <para>where <parameter>filechooser</parameter> is the object that
received the signal and <parameter>user_data</parameter> is the user data
set when the signal handler was connected.</para>

      <para>The "GtkFileChooserDefault::down-folder" signal 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", then this will cause the file chooser to switch to the "baz"
subfolder. By default this is bound to
<keycombo><keycap>Alt</keycap><keycap>Down</keycap> </keycombo>.</para>

      <programlisting>
  def down_folder_cb(filechooser, user_data):
</programlisting>

      <para>where <parameter>filechooser</parameter> is the object that
received the signal and <parameter>user_data</parameter> is the user data
set when the signal handler was connected.</para>

      <para>The "GtkFileChooserDefault::home-folder" signal is used to make
the file chooser show the user's home folder in the file list. By default
this is bound to <keycombo><keycap>Alt</keycap><keycap>Home</keycap>
</keycombo>.</para>

      <programlisting>
  def home_folder_cb(filechooser, user_data):
</programlisting>
	
      <para>where <parameter>filechooser</parameter> is the object that
received the signal and <parameter>user_data</parameter> is the user data
set when the signal handler was connected.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkfilechooser--set-action">
      <title>gtk.FileChooser.set_action</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_action</methodname>
	  <methodparam><parameter role="keyword">action</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">action</parameter>&nbsp;:</term>
	  <listitem>
	    <simpara>the file selection action - one of:
<literal>gtk.FILE_CHOOSER_ACTION_OPEN</literal>,
<literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal>,
<literal>gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER</literal> or
<literal>gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</literal>.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_action</methodname>() method sets the
"action" property to the value of <parameter>action</parameter>. The type of
operation that that the chooser is performing is set by
<parameter>action</parameter> causing the user interface to be changed to
suit the selected action. The value of <parameter>action</parameter> must be
one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.FILE_CHOOSER_ACTION_OPEN</literal></term>
	  <listitem>
	    <simpara>Indicates open mode. The file chooser will only let the
user pick an existing file.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal></term>
	  <listitem>
	    <simpara>Indicates save mode. The file chooser will let the user
pick an existing file, or type in a new filename.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER</literal></term>
	  <listitem>
	    <simpara>Indicates an open mode for selecting folders. The file
chooser will let the user pick an existing folder.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</literal></term>
	  <listitem>
	    <simpara>Indicates a mode for creating a new folder. The file
chooser will let the user name an existing or new folder </simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>For example, an option to create a new folder might be shown if
the action is <literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal> but not if the
action is <literal>gtk.FILE_CHOOSER_ACTION_OPEN</literal>.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-action">
      <title>gtk.FileChooser.get_action</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_action</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem>
	    <simpara>the action that is set for the file
selector</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_action</methodname>() method returns the
value of the "action" property that indicates the type of operation that the
file chooser is set to perform. See the <link
linkend="method-gtkfilechooser--set-action"><methodname>set_action()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-local-only">
      <title>gtk.FileChooser.set_local_only</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_local_only</methodname>
	  <methodparam><parameter role="keyword">local_only</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">local_only</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, only local files can
be selected</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_local_only</methodname>() method sets the
"local-only" property to the value of <parameter>local_only</parameter>. If
<parameter>local_only</parameter> is <literal>True</literal> (the default),
only local files can be selected in the file selector and the selected files
are guaranteed to be accessible through the operating system's native file
system. Therefore, the application only needs to use the filename methods in
<link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>.
For example, the application can use the <link
linkend="method-gtkfilechooser--get-filename"><methodname>get_filename()</methodname></link>
method instead of the URI method <link
linkend="method-gtkfilechooser--get-uri"><methodname>get_uri()</methodname></link>.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-local-only">
      <title>gtk.FileChooser.get_local_only</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_local_only</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if only local files can be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_local_only</methodname>() method returns the
value of the "local-only" property that indicates whether only local files
can be selected in the file selector. See the <link
linkend="method-gtkfilechooser--set-local-only"><methodname>set_local_only()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-select-multiple">
      <title>gtk.FileChooser.set_select_multiple</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_select_multiple</methodname>
	  <methodparam><parameter role="keyword">select_multiple</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">select_multiple</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> multiple files can be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_select_multiple</methodname>() method sets
the "select_multiple" property to the value of
<parameter>select_multiple</parameter>. If
<parameter>select_multiple</parameter> is <literal>True</literal>, multiple
files can be selected in the file selector.</para>

      <note>
	<para>The "select-multiple" property cannot be set
<literal>True</literal> when the file chooser action is
<literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal> or
<literal>gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER</literal>.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-select-multiple">
      <title>gtk.FileChooser.get_select_multiple</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_select_multiple</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if multiple files can be
selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_select_multiple</methodname>() method
returns the value of the "select_multiple" property that indicates whether
multiple files can be selected in the file selector. See the <link
linkend="method-gtkfilechooser--set-select-multiple"><methodname>set_select_multiple()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-current-name">
      <title>gtk.FileChooser.set_current_name</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_current_name</methodname>
	  <methodparam><parameter role="keyword">name</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">name</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename to use, as a UTF-8
string</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_current_name</methodname>() method sets the
current name in the file selector to the value of
<parameter>name</parameter>, as if entered by the user. Note that the name
passed in here is a UTF-8 string rather than a filename. This method is
meant for such uses as a suggested name in a "Save As..." dialog.</para>

      <para>If you want to preselect a particular existing file, you should
use the <link
linkend="method-gtkfilechooser--set-filename"><methodname>set_filename()</methodname></link>
method instead.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-filename">
      <title>gtk.FileChooser.get_filename</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_filename</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The currently selected filename, or
<literal>None</literal> if no file is selected, or the selected file can't
be represented with a local filename.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_filename</methodname>() method returns the
filename of 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.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-filename">
      <title>gtk.FileChooser.set_filename</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_filename</methodname>
	  <methodparam><parameter role="keyword">filename</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename to set as current</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could
be changed and the file was selected successfully, <literal>False</literal>
otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_filename</methodname>() method sets
<parameter>filename</parameter> as the current filename for the the file
chooser.  If the file name isn't in the current folder of the chooser, then
the current folder of the chooser will be changed to the folder containing
<parameter>filename</parameter>. This is equivalent to a sequence of <link
linkend="method-gtkfilechooser--unselect-all"><methodname>unselect_all()</methodname></link>
followed by <link
linkend="method-gtkfilechooser--select-filename"><methodname>select_filename()</methodname></link>.</para>

      <para>Note that the file must exist, or nothing will be done except
for the directory change. To pre-enter a filename for the user, as in a
"Save as ..." dialog, use the <link
linkend="method-gtkfilechooser--set-current-name"><methodname>set_current_name()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--select-filename">
      <title>gtk.FileChooser.select_filename</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_filename</methodname>
	  <methodparam><parameter role="keyword">filename</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename to select</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could
be changed and the file was selected successfully, <literal>False</literal>
otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>select_filename</methodname>() method selects
the filename specified by <parameter>filename</parameter>. If
<parameter>filename</parameter> isn't in the current folder of the chooser,
then the current folder of the chooser will be changed to the folder
containing <parameter>filename</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--unselect-filename">
      <title>gtk.FileChooser.unselect_filename</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_filename</methodname>
	  <methodparam><parameter role="keyword">filename</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename to unselect</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>unselect_filename</methodname>() method
unselects the currently selected filename specified by
<parameter>filename</parameter>. If <parameter>filename</parameter> is not
in the current directory, does not exist, or is otherwise not currently
selected, this method does nothing.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--select-all">
      <title>gtk.FileChooser.select_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_all</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>select_all</methodname>() method selects all the
files in the current folder of a file chooser.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--unselect-all">
      <title>gtk.FileChooser.unselect_all</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_all</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>unselect_all</methodname>() method unselects all
 the files in the current folder of a file chooser.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-filenames">
      <title>gtk.FileChooser.get_filenames</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_filenames</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list containing the filenames of all selected
files and subfolders in the current folder.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_filenames</methodname>() method returns a
list containing all the selected files and subfolders in the current folder
of the chooser. The returned names are full absolute paths. If files in the
current folder cannot be represented as local filenames they will be
ignored. (See the <link
linkend="method-gtkfilechooser--get-uris"><methodname>get_uris()</methodname></link>
method for more information)</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-current-folder">
      <title>gtk.FileChooser.set_current_folder</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_current_folder</methodname>
	  <methodparam><parameter role="keyword">filename</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the full path of the new current
folder</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder could be
changed successfully, <literal>False</literal> otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_current_folder</methodname>() method sets
the current folder for the chooser to the local filename specified by
<parameter>filename</parameter>. The user will be shown the full contents
of the current folder, plus user interface elements for navigating to other
folders.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-current-folder">
      <title>gtk.FileChooser.get_current_folder</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_current_folder</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the full path of the current folder, or
<literal>None</literal> if the current path cannot be represented as a local
filename.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_current_folder</methodname>() method returns
the current folder of the chooser as a local filename. See the <link
linkend="method-gtkfilechooser--set-current-folder"><methodname>set_current_folder()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-uri">
      <title>gtk.FileChooser.get_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_uri</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The currently selected URI, or
<literal>None</literal> if no file is selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_uri</methodname>() method returns 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.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-uri">
      <title>gtk.FileChooser.set_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>the URI to set as the current
file</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could
be changed and the URI was successfully selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_uri</methodname>() method sets the file
referred to by <parameter>uri</parameter> as the current file for the file
chooser; If the file name isn't in the current folder of the chooser, then
the current folder of the chooser will be changed to the folder containing
<parameter>uri</parameter>. This is equivalent to the sequence of <link
linkend="method-gtkfilechooser--unselect-all"><methodname>unselect_all()</methodname></link>
followed by <link
linkend="method-gtkfilechooser--select-uri"><methodname>select_uri()</methodname></link>.
Note that the file must exist, or nothing will be done except for the
directory change. To pre-enter a filename for the user, as in a "Save As
..."  dialog, use the <link
linkend="method-gtkfilechooser--set-current-name"><methodname>set_current_name()</methodname></link>
method.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--select-uri">
      <title>gtk.FileChooser.select_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>the URI of the file to select</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could
be changed and the URI was successfully selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>select_uri</methodname>() method selects the
file referred to by <parameter>uri</parameter>. If the URI doesn't refer to
a file in the current folder of the chooser, then the current folder of the
chooser will be changed to the folder containing the file referenced by
<parameter>uri</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--unselect-uri">
      <title>gtk.FileChooser.unselect_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>the URI of the file to
unselect</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>unselect_uri</methodname>() method unselects the
file referred to by <parameter>uri</parameter>. If the file is not in the
current directory, does not exist, or is otherwise not currently selected,
this method does nothing.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-uris">
      <title>gtk.FileChooser.get_uris</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_uris</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list containing the URIs of all selected
files and subfolders in the current folder.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_uris</methodname>() method returns a list
containing all the selected files and subfolders in the current folder of
the chooser. The returned names are full absolute URIs.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-current-folder-uri">
      <title>gtk.FileChooser.set_current_folder_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_current_folder_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>the URI for the new current
folder</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder could be
changed successfully, <literal>False</literal> otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_current_folder_uri</methodname>() method
sets the current folder for the chooser to the folder referenced by
<parameter>uri</parameter>. The user will be shown the full contents of the
current folder, plus user interface elements for navigating to other
folders.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-current-folder-uri">
      <title>gtk.FileChooser.get_current_folder_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_current_folder_uri</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the URI for the current
folder.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_current_folder_uri</methodname>() method
returns the URI reference of the current folder of the chooser.  See the
<link
linkend="method-gtkfilechooser--set-current-folder-uri"><methodname>set_current_folder_uri()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-preview-widget">
      <title>gtk.FileChooser.set_preview_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_preview_widget</methodname>
	  <methodparam><parameter role="keyword">preview_widget</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">preview_widget</parameter>&nbsp;:</term>
	  <listitem><simpara>a widget for displaying a
preview.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_preview_widget</methodname>() method sets
the "preview-widget" property to the value of
<parameter>preview_widget</parameter>. The
<parameter>preview_widget</parameter> is used to preview the currently
selected file. To implement a custom preview:</para>

    <itemizedlist>
      <listitem>
	<simpara>set the preview widget</simpara>
      </listitem>
      <listitem>
	<simpara>connect a callback to the "selection-changed" signal of the
file chooser</simpara>
      </listitem>
      <listitem>
	<simpara>in the callback, call the <link
linkend="method-gtkfilechooser--get-preview-filename"><methodname>get_preview_filename()</methodname></link>
method or the <link
linkend="method-gtkfilechooser--get-preview-uri"><methodname>get_preview_uri()</methodname></link>
method to retrieve the selected file name or URI</simpara>
      </listitem>
      <listitem>
	<simpara>if you can, display a preview of the selected file and set
the preview active using the <link
linkend="method-gtkfilechooser--set-preview-widget-active"><methodname>set_preview_widget_active()</methodname></link>
method</simpara>
      </listitem>
      <listitem>
	<simpara>otherwise, set the preview inactive</simpara>
      </listitem>
   </itemizedlist>

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

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-preview-widget">
      <title>gtk.FileChooser.get_preview_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_preview_widget</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current preview widget, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_preview_widget</methodname>() method returns
the value of the "preview_widget" property i.e. the current preview
widget. See the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-preview-widget-active">
      <title>gtk.FileChooser.set_preview_widget_active</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_preview_widget_active</methodname>
	  <methodparam><parameter role="keyword">active</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">active</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, display the
user-specified preview widget</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_preview_widget_active</methodname>() method
sets the "preview_widget_active" property to the value of
<parameter>active</parameter>. If <parameter>active</parameter> is
<literal>True</literal>, the preview widget set by the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method should be shown for the current filename. When
<parameter>active</parameter> is <literal>False</literal>, the file chooser
may display an internally generated preview of the current file or it may
display no preview at all. See the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
for more details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-preview-widget-active">
      <title>gtk.FileChooser.get_preview_widget_active</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_preview_widget_active</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the preview widget is
active for the current filename.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_preview_widget_active</methodname>() method
returns the value of the "preview-widget-active" property that indicates
whether the preview widget set by the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method should be shown for the current filename. See the <link
linkend="method-gtkfilechooser--set-preview-widget-active"><methodname>set_preview_widget_active()</methodname></link>
method for more details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-use-preview-label">
      <title>gtk.FileChooser.set_use_preview_label</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_use_preview_label</methodname>
	  <methodparam><parameter role="keyword">use_label</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">use_label</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal>, display a stock label
with the name of the previewed file</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_use_preview_label</methodname>() method sets
the "use-preview-label" property to the value of
<parameter>use_label</parameter>. If <parameter>use_label</parameter> is
<literal>True</literal> (the default), the file chooser should display a
stock label with the name of the file that is being previewed. Applications
that want to draw the whole preview area themselves should set this to
<literal>False</literal> and display the name themselves in their preview
widget. See the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-use-preview-label">
      <title>gtk.FileChooser.get_use_preview_label</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_use_preview_label</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the file chooser is
set to display a label with the name of the previewed file;
<literal>False</literal> otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_use_preview_label</methodname>() method
returns the value of the "use-preview-label" property that indicates whether
a stock label should be drawn with the name of the previewed file. See the
<link
linkend="method-gtkfilechooser--set-use-preview-label"><methodname>set_use_preview_label()</methodname></link>
for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-preview-filename">
      <title>gtk.FileChooser.get_preview_filename</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_preview_filename</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the filename to preview, or
	  <literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_preview_filename</methodname>() method
returns the filename that should be previewed in a custom preview widget or
<literal>None</literal> if no file is selected, or if the selected file
cannot be represented as a local filename. See the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method for more details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-preview-uri">
      <title>gtk.FileChooser.get_preview_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_preview_uri</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the URI for the file to preview, or
<literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_preview_uri</methodname>() method returns
the URI of the file that should be previewed in a custom preview widget or
<literal>None</literal> if no file is selected. See the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget()</methodname></link>
method fr more details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-extra-widget">
      <title>gtk.FileChooser.set_extra_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_extra_widget</methodname>
	  <methodparam><parameter role="keyword">extra_widget</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">extra_widget</parameter>&nbsp;:</term>
	  <listitem><simpara>the widget to display extra
options</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_extra_widget</methodname>() method sets the
"extra-widget" property to the value of
<parameter>extra_widget</parameter>. <parameter>extra_widget</parameter> is
an application-supplied widget used to display extra options to the
user.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-extra-widget">
      <title>gtk.FileChooser.get_extra_widget</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_extra_widget</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current extra widget, or
<literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_extra_widget</methodname>() method returns
the value of the "extra-widget" property that contains either a widget used
to display extra options to the user or <literal>None</literal> if no extra
widget is in use. See the <link
linkend="method-gtkfilechooser--set-extra-widget"><methodname>set_extra_widget()</methodname></link>
for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--add-filter">
      <title>gtk.FileChooser.add_filter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_filter</methodname>
	  <methodparam><parameter role="keyword">filter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filter</parameter>&nbsp;:</term>
	  <listitem><simpara>a
<link linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>add_filter</methodname>() method adds the <link
linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link>
specified by <parameter>filter</parameter> to the list of filters that the
user can select from. When a filter is selected, only files that are
passed by that filter are displayed.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--remove-filter">
      <title>gtk.FileChooser.remove_filter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>remove_filter</methodname>
	  <methodparam><parameter role="keyword">filter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filter</parameter>&nbsp;:</term>
	  <listitem><simpara>a
<link linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>remove_filter</methodname>() method removes the
<link
linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link>
specified by <parameter>filter</parameter> from the list of filters that the
user can select from.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--list-filters">
      <title>gtk.FileChooser.list_filters</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>list_filters</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list containing the current set of
user selectable filters.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>list_filters</methodname>() method returns the
current set of user-selectable filters. See the <link
linkend="method-gtkfilechooser--add-filter"><methodname>add_filter()</methodname></link>
and <link
linkend="method-gtkfilechooser--remove-filter"><methodname>remove_filter()</methodname></link>
method for more details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-filter">
      <title>gtk.FileChooser.set_filter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_filter</methodname>
	  <methodparam><parameter role="keyword">filter</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filter</parameter>&nbsp;:</term>
	  <listitem><simpara>a
<link linkend="class-gtkfilefilter"><classname>gtk.FileFilter</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>set_filter</methodname>() method sets the
"filter" property to the value of <parameter>filter</parameter> and also
sets the current filter to <parameter>filter</parameter>. Only the files
that pass <parameter>filter</parameter> will be displayed. If the
user-selectable list of filters is non-empty, then
<parameter>filter</parameter> 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.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-filter">
      <title>gtk.FileChooser.get_filter</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_filter</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the current filter, or
<literal>None</literal>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>get_filter</methodname>() method returns the
value of the "filter" property which is the current filter. See the <link
linkend="method-gtkfilechooser--set-filter"><methodname>set_filter()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--add-shortcut-folder">
      <title>gtk.FileChooser.add_shortcut_folder</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_shortcut_folder</methodname>
	  <methodparam><parameter role="keyword">folder</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">folder</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename of the folder to
add</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder could be
added successfully.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>add_shortcut_folder</methodname>() adds the
folder specified by <parameter>folder</parameter> the list of shortcut
folders in a file chooser. Shortcut folders are displayed at the upper left
in the <link
linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>. By
double-clicking on a shortcut the user can open that folder directly. 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.</para>

      <para>The GError exception is raised if an error occurred while adding
the folder.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--remove-shortcut-folder">
      <title>gtk.FileChooser.remove_shortcut_folder</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>remove_shortcut_folder</methodname>
	  <methodparam><parameter role="keyword">folder</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">folder</parameter>&nbsp;:</term>
	  <listitem><simpara>the filename of the folder to
remove</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if
	  <parameter>folder</parameter> was removed from the list of
	  shortcut folders.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>remove_shortcut_folder</methodname>() method
removes the folder specified by <parameter>folder</parameter> from a file
chooser's list of shortcut
folders. <methodname>remove_shortcut_folder</methodname>() returns True if
successful. See the <link
linkend="method-gtkfilechooser--add-shortcut-folder"><methodname>add_shortcut_folder()</methodname></link>
method for more information.</para>

      <para>The GError exception is raised if an error occurred while
removing the folder.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--list-shortcut-folders">
      <title>gtk.FileChooser.list_shortcut_folders</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>list_shortcut_folders</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>A list of shortcut folder filenames, or
<literal>None</literal> if there are no shortcut folders.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>list_shortcut_folders</methodname>() method
returns the list of shortcut folders in the file chooser, as set by the
<link
linkend="method-gtkfilechooser--add-shortcut-folder"><methodname>add_shortcut_folder</methodname>()</link>
method or <literal>None</literal> if there are no shortcut folders. It is
not possible to get a list of the user-specified shortcut folders.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--add-shortcut-folder-uri">
      <title>gtk.FileChooser.add_shortcut_folder_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_shortcut_folder_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>the URI of the folder to add</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder was
added</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>add_shortcut_folder_uri</methodname>() method
adds a folder with the URI specified by <parameter>uri</parameter> to the
list of 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. See the <link
linkend="method-gtkfilechooser--add-shortcut-folder"><methodname>add_shortcut_folder</methodname>()</link>
method for more details.</para>

      <para>The GError exception is raised if an error occurred while adding
the folder.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--remove-shortcut-folder-uri">
      <title>gtk.FileChooser.remove_shortcut_folder_uri</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>remove_shortcut_folder_uri</methodname>
	  <methodparam><parameter role="keyword">uri</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">uri</parameter>&nbsp;:</term>
	  <listitem><simpara>URI of the folder to remove</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder was
removed.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>remove_shortcut_folder_uri</methodname>() method
removes the folder with the URI specified by <parameter>uri</parameter> from
the file chooser's list of shortcut folders.</para>

      <para>The GError exception is raised if an error occurred while
removing the folder.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--list-shortcut-folder-uris">
      <title>gtk.FileChooser.list_shortcut_folder_uris</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>list_shortcut_folder_uris</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of shortcut folder URIs, or
<literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>list_shortcut_folder_uris</methodname>() method
returns a list of the shortcut folders in the file chooser, as set by the
<link
linkend="method-gtkfilechooser--add-shortcut-folder-uri"><methodname>add_shortcut_folder_uri</methodname>()</link>
method. It is not possible to get a list of the user-specified folder
URIs.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-show-hidden">
      <title>gtk.FileChooser.set_show_hidden</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_show_hidden</methodname>
	  <methodparam><parameter role="keyword">show_hidden</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">show_hidden</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> hidden files and
folders should be displayed.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>set_show_hidden</methodname>() method sets the
"show-hidden" property to the value of
<parameter>show_hidden</parameter>. If <parameter>show_hidden</parameter> is
<literal>True</literal>, hidden files and folders should be displayed in the
file selector.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-show-hidden">
      <title>gtk.FileChooser.get_show_hidden</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_show_hidden</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if hidden files and
folders are displayed.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>get_show_hidden</methodname>() method returns
the value of the "show-hidden" property that indicates whether hidden files
and folders should be displayed in the file selector. See the <link
linkend="method-gtkfilechooser--set-show-hidden"><methodname>set_show_hidden()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-do-overwrite-confirmation">
      <title>gtk.FileChooser.set_do_overwrite_confirmation</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_do_overwrite_confirmation</methodname>
	  <methodparam><parameter role="keyword">do_overwrite_confirmation</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">do_overwrite_confirmation</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> ask the user for
confirmation before overwriting a file in save mode.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>set_do_overwrite_confirmation</methodname>()
method sets the "do-overwrite-confirmation" property to the value of
<parameter>do_overwrite_confirmation</parameter>. If
<parameter>do_overwrite_confirmation</parameter> is <literal>True</literal>
and the "action" property is set to
<literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal>, the file chooser will
present a confirmation dialog if the user attempts to overwrite an existing
file. The default value is <literal>False</literal>.</para>

      <para>If all you need is the stock confirmation dialog, set the
"do-overwrite-confirmation" property to <literal>True</literal>. You can
override the way confirmation is done by actually handling the
"confirm-overwrite" signal; please refer to its documentation for
details.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-do-overwrite-confirmation">
      <title>gtk.FileChooser.get_do_overwrite_confirmation</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_do_overwrite_confirmation</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if hidden files and
folders are displayed.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>get_do_overwrite_confirmation</methodname>()
method returns the value of the "do-overwrite-confirmation" property that
indicates whether a user is asked for confirmation before overwriting an
existing file. See the <link
linkend="method-gtkfilechooser--set-do-overwrite-confirmation"><methodname>set_do_overwrite_confirmation()</methodname></link>
method for more information.</para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-current-folder-file">
      <title>gtk.FileChooser.get_current_folder_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_current_folder_file</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The <link linkend="class-giofile">
	  <classname>gio.File</classname></link>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>get_current_folder_file</methodname>() method returns
	the current folder of chooser as <link linkend="class-giofile"><classname>gio.File</classname></link>.
	See <link linkend="method-gtkfilechooser--get-current-folder-uri">gtk.FileChooser.get_current_folder_uri</link>().
      </para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--get-file">
      <title>gtk.FileChooser.get_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_file</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>A selected <link linkend="class-giofile">
	  <classname>gio.File</classname></link>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>get_file</methodname>() method returns
	the <link linkend="class-giofile"><classname>gio.File</classname></link>
	for the currently selected file in the file selector.
	If multiple files are selected, one of the files will be returned at random. 
      </para>
      <para>
	If the file chooser is in folder mode, this function returns the selected folder.
      </para>

    </refsect2>
    
    <!-- NOT IMPLEMENTED
    <refsect2 id="method-gtkfilechooser- -get-files">
      <title>gtk.FileChooser.get_files</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_files</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>A list containing a  <link linkend="class-giofile">
	  <classname>gio.File</classname></link> for each selected file and subfolder
	  in the current folder.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>get_files</methodname>() method returns
	Lists all the selected files and subfolders in the current folder of chooser as
	<link linkend="class-giofile"><classname>gio.File</classname></link>. An internal function, see
	<link linkend="method-gtkfilechooser- -get-uris">gtk.FileChooser.get_uris</link>().
      </para>

    </refsect2> -->

    <refsect2 id="method-gtkfilechooser--get-preview-file">
      <title>gtk.FileChooser.get_preview_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_preview_file</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>The <link linkend="class-giofile">
	  <classname>gio.File</classname></link> for the file to preview,
	  or <literal>None</literal> if no file is selected.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>get_preview_file</methodname>() method returns
	the <link linkend="class-giofile"><classname>gio.File</classname></link>
	that should be previewed in a custom preview Internal function, see
	<link linkend="method-gtkfilechooser--get-preview-uri">gtk.FileChooser.get_preview_uri</link>().
      </para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--select-file">
      <title>gtk.FileChooser.select_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>select_file</methodname>
	  <methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">file</parameter>&nbsp;:</term>
	  <listitem><simpara>the file to select.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could be changed
	  and the path was selected successfully,
	  <literal>False</literal> otherwise. </simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>select_file</methodname>() method
	selects the file referred to by file. An internal function. See
	<link linkend="method-gtkfilechooser--select-uri">gtk.FileChooser.select_uri</link>().
      </para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-current-folder-file">
      <title>gtk.FileChooser.set_current_folder_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_current_folder_file</methodname>
	  <methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">file</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link linkend="class-giofile"><classname>gio.File</classname></link>
	  for the new folder.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the folder could be changed
	  successfully, <literal>False</literal> otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>set_current_folder_file</methodname>() method
	sets the current folder for chooser from a
	<link linkend="class-giofile"><classname>gio.File</classname></link>.
	Internal function, see
	<link linkend="method-gtkfilechooser--set-current-folder-uri">gtk.FileChooser.set_current_folder_uri</link>().
      </para>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--set-file">
      <title>gtk.FileChooser.set_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_file</methodname>
	  <methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">file</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link linkend="class-giofile"><classname>gio.File</classname></link>
	  to set as current.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if both the folder could be changed
	  and the file selected successfully, <literal>False</literal> otherwise.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>set_file</methodname>() method
	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. 
      </para>
      <para>
	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
	<link linkend="method-gtkfilechooser--unselect-all">gtk.FileChooser.unselect_all</link>()
	followed by <link linkend="method-gtkfilechooser--select-filename">gtk.FileChooser.select_filename</link>().
      </para>
      <para>
	Note that the file must exist, or nothing will be done except for the directory change.
      </para>
      <para>
	If you are implementing a File/Save As... dialog, you should use this function
	if you already have a file name to which the user may save; for example,
	when the user opens an existing file and then does File/Save As... on it.
	If you don't have a file name already — for example, if the user just created a
	new file and is saving it for the first time, do not call this function. Instead,
	use something similar to this:
      </para>
<programlisting>
if (document_is_new):
    # the user just created a new document
    chooser.set_current_folder_file(default_file_for_saving)
    chooser.set_current_name("Untitled document")
else:
    # the user edited an existing document
    chooser.set_file(existing_file)
</programlisting>

    </refsect2>

    <refsect2 id="method-gtkfilechooser--unselect-file">
      <title>gtk.FileChooser.unselect_file</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>unselect_file</methodname>
	  <methodparam><parameter role="keyword">file</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">file</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link linkend="class-giofile"><classname>gio.File</classname></link>.
	  </simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.14 and above.</para>
      </note>

      <para>
	The <methodname>unselect_file</methodname>() method
	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.
      </para>

    </refsect2>
    
  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkfilechooser--confirm-overwrite">
      <title>The "confirm-overwrite" gtk.FileChooser Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>filechooser</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>filechooser</parameter>&nbsp;:</term>
	  <listitem><simpara>the filechooser widget that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara> one of the <xref
linkend="gtk-filechooser-confirmation-constants"
endterm="gtk-filechooser-confirmation-constants-title"></xref>
indicating what action GTK+ should take.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.8 and above.</para>
      </note>

      <para>The "confirm-overwrite" signal is emitted when it is appropriate
to present a confirmation dialog when the user has selected a file name that
already exists. The signal is only emitted when the file chooser "action" property is set to <literal>gtk.FILE_CHOOSER_ACTION_SAVE</literal>.</para>

      <para> Most applications just need to turn on the
"do-overwrite-confirmation" property (or call the <link
linkend="method-gtkfilechooser--set-do-overwrite-confirmation"><methodname>set_do_overwrite_confirmation</methodname>()</link>
method), to automatically get a stock confirmation dialog. Applications
that need to customize this behavior should do that, and also connect to
the "confirm-overwrite" signal.</para>

      <para>A signal handler for this signal must return one of the <xref
linkend="gtk-filechooser-confirmation-constants"
endterm="gtk-filechooser-confirmation-constants-title"></xref> that
indicates the action to take. If the handler determines that the user wants
to select a different filename, it should return
<literal>gtk.FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN</literal>. If it
determines that the user is satisfied with his choice of file name, it
should return
<literal>gtk.FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME</literal>. On the
other hand, if it determines that the stock confirmation dialog should be
used, it should return
<literal>gtkfile_CHOOSER_CONFIRMATION_CONFIRM</literal>. The following
psuedo-code example illustrates this.</para>

      <programlisting>
def confirm_overwrite_callback(chooser):
  uri = chooser.get_uri()

  if is_uri_read_only(uri):
    if user_wants_to_replace_read_only_file (uri):
      return gtk.FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME
    else
      return gtk.FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
  else
    # fall back to the default dialog
    return gtk.FILE_CHOOSER_CONFIRMATION_CONFIRM 

...

chooser = gtk.FileChooserDialog(...)

chooser.set_do_overwrite_confirmation(True)
chooser.connect("confirm-overwrite", confirm_overwrite_callback)

if chooser.run() == gtk.RESPONSE_ACCEPT:
  save_to_file(chooser.get_filename()

chooser.destroy()
</programlisting>

    </refsect2>

    <refsect2 id="signal-gtkfilechooser--current-folder-changed">
      <title>The "current-folder-changed" gtk.FileChooser Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>filechooser</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>filechooser</parameter>&nbsp;:</term>
	  <listitem><simpara>the filechooser widget that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The "current-folder-changed" signal is emitted when the current
folder displayed in <parameter>filechooser</parameter> is changed. Normally
you do not need to connect to this signal, unless you need to keep track of
which folder a file chooser is showing.</para>

    </refsect2>

    <refsect2 id="signal-gtkfilechooser--file-activated">
      <title>The "file-activated" gtk.FileChooser Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>filechooser</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>filechooser</parameter>&nbsp;:</term>
	  <listitem><simpara>the filechooser widget that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The "file-activated" signal is emitted when the user
double-clicks on a file (not a folder) or presses
<keycap>Enter</keycap>. Normally you do not need to connect to this
signal. It is used internally by <link
linkend="class-gtkfilechooserdialog"><classname>gtk.FileChooserDialog</classname></link>
to know when to activate the default button in the dialog.</para>

    </refsect2>

    <refsect2 id="signal-gtkfilechooser--selection-changed">
      <title>The "selection-changed" gtk.FileChooser Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>filechooser</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>filechooser</parameter>&nbsp;:</term>
	  <listitem><simpara>the filechooser widget that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The "selection-changed" signal is emitted when the file
selection in <parameter>filechooser</parameter> is changed either by
clicking on a filename or by changing the current folder. Normally you do
not need to connect to this signal, as it is easier to wait for the file
chooser to finish running, and then to get the list of selected files using
the functions mentioned below.</para>

    </refsect2>

    <refsect2 id="signal-gtkfilechooser--update-preview">
      <title>The "update-preview" gtk.FileChooser Signal</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>callback</methodname>
	  <methodparam><parameter>filechooser</parameter></methodparam>
	  <methodparam><parameter>user_param1</parameter></methodparam>
	  <methodparam><parameter>...</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
	<varlistentry>
	  <term><parameter>filechooser</parameter>&nbsp;:</term>
	  <listitem><simpara>the filechooser widget that received the
signal</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
with the <link
linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
method</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>...</parameter>&nbsp;:</term>
	  <listitem><simpara>additional user parameters (if
any)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This signal is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The "update-preview" signal is emitted when the preview when a
file chooser should be regenerated. For example, this can happen when the
currently selected file changes. You should use this signal if you want your
file chooser to have a preview widget.</para>

      <para>Once you have installed a preview widget with the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget</methodname>()</link>
method, you should update it when this signal is emitted. You can use the
methods <link
linkend="method-gtkfilechooser--get-preview-filename"><methodname>get_preview_filename</methodname>()</link>
or <link
linkend="method-gtkfilechooser--get-preview-uri"><methodname>get_preview_uri</methodname>()</link>
to get the name of the file to preview. Your widget may not be able to
preview all kinds of files so your callback must call the <link
linkend="method-gtkfilechooser--set-preview-widget-active"><methodname>set_preview_widget_active</methodname>()</link>
to inform the file chooser if the preview was generated successfully or
not.</para>

      <para>Please see the example code in the section called <link
linkend="AddingAPreviewWidget">Adding a Preview Widget</link>.</para>

      <para>Also see the <link
linkend="method-gtkfilechooser--set-preview-widget"><methodname>set_preview_widget</methodname>()</link>,
<link
linkend="method-gtkfilechooser--set-preview-widget-active"><methodname>set_preview_widget_active</methodname>()</link>,
<link
linkend="method-gtkfilechooser--set-use-preview-label"><methodname>set_use_preview_label</methodname>()</link>,
<link
linkend="method-gtkfilechooser--get-preview-filename"><methodname>get_preview_filename</methodname>()</link>
and <link
linkend="method-gtkfilechooser--get-preview-uri"><methodname>get_preview_uri</methodname>()</link>
methods for more information</para>

    </refsect2>

  </refsect1>

</refentry>
