GtkFileChooserButton 'Select Folder' mode returns no path

Posted by user8592 on Ask Ubuntu See other posts from Ask Ubuntu or by user8592
Published on 2012-07-04T07:49:59Z Indexed on 2012/07/04 9:23 UTC
Read the original article Hit count: 269

I have added a GtkFileChooserButton to my app via Glade. It is set to folder selection mode. When the widget is clicked it shows a dropdown list of Nautilus bookmarks with an 'other' option in the end. A new file chooser dialog is launched when 'other' is clicked. The button is not connected to any other custom file chooser dialog.

The connecting signal I am using is 'file-set' and I am retrieving the fullpath of user selected folder using Gtk.FileChooser.get_current_folder ().

This setup works fine if user selects a folder from 'other' option. But if a user selects a bookmark from dropdown list, no path is returned. How to solve this?

Is there a way to disable this dropdown list and directly go to the filechooser dialog? I want to use GtkFileChooserButton only so that the user can get a preview of his selected folder.

© Ask Ubuntu or respective owner

Related posts about application-development

Related posts about gtk