GtkFileChooserButon reset to initial state before file selection
<p>How to reset a <code>GtkFileChooserButton</code> for its initial state, ie before file selection?</p>

<p>code:</p>

<pre><code>#!/usr/bin/env python3

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

def file_changed(filechooserbutton):
    print("File selected: %s" % filechooserbutton.get_filename())

window = Gtk.Window()
window.set_title("FileChooserButton")
window.set_default_size(150, -1)
window.connect("destroy", Gtk.main_quit)

filechooserbutton = Gtk.FileChooserButton(title="FileChooserButton")
filechooserbutton.connect("file-set", file_changed)
window.add(filechooserbutton)

window.show_all()

Gtk.main()
</code></pre>

<p>Before file selection:</p>

<p><a href="http://i.stack.imgur.com/V6Dib.png" rel="nofollow"><img src="http://i.stack.imgur.com/V6Dib.png" alt="enter image description here"></a></p>

<p>After file selection:</p>

<p><a href="http://i.stack.imgur.com/i8VOE.png" rel="nofollow"><img src="http://i.stack.imgur.com/i8VOE.png" alt="enter image description here"></a></p>

<p>GtkFileChooserButton implements GtkFileChooser, so you can use the <a href="https://developer.gnome.org/gtk3/stable/GtkFileChooser.html#gtk-file-chooser-unselect-all" rel="nofollow">unselect_all</a> function.</p>

python gtk