Setting up GtkFileChooser

GTK + noob question:

Can I configure GtkFileChooserButton or GtkFileChooserDialog to delete the "Places" section (left) and "Place" at the top?

What I'm trying to do is allow the user to select files only from a specific folder (which I set using gtk_file_chooser_set_current_folder) and disable navigation to other places in the file system.

This is the standard file selection dialog: The standard GtkFilechooser Dialog

This is what I need: enter image description here

+5
source share
2 answers

, . , - , , , .

, , GtkFileChooser GtkFileChooserDialog, .

+5

, , gtkparasite, get_children.

.show() .run() gtkparasite. .run(), , .

, Path and Places :

dialog = gtk.FileChooserDialog("Open***", None, gtk.FILE_CHOOSER_ACTION_OPEN,
            (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN, gtk.RESPONSE_OK))
dialog.set_show_hidden(True)
dialog.set_default_response(gtk.RESPONSE_OK)       
vbox = dialog.get_children()[0].get_children()[0].get_children( [0].get_children()[0]
vbox.get_children()[0].hide()
vbox.get_children()[2].get_children()[0].hide()

, API, .

, ...

, ....

+4

All Articles