I'm trying hard to find out how to use the file chooser button properly. Reading the reference manual on GtkFileChooserButton, GtkFileChooserDialog and GtkFileChooser didn't help so far. I've tried connecting to the undocumented signal file-set of GtkFileChooserButton and calling get_filename() from here, but it seems to behave quite unreliably. When the user clicks the button and selects a file, it works fine so far.
But, if after clicking on the same button (which already has a filename set), the user changes his mind and closes the "open file" dialog, get_filename() returns None (a Python type, i write it using pygtk) while the file remains set. Even more weird, if i call get_filename() on that button later from within another signal handler, the filename returns to what it previously had been set by the user. By the way, only closing the dialog box seems to cause the problem, pressing "cancel" works just fine.