Есть код:
def on_clicked_file (self, widget):
response = dialog.run()
if response == gtk.RESPONSE_OK:
text_file.set_text(dialog.get_filename())
print "selected"
elif response == gtk.RESPONSE_CANCEL:
print 'no file selected'
dialog.destroy()