Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i want to get the location of the folder that is selected by a filechooserbutton in pygtk... how can i do this?

i connect the current folder changed signal from filechooser but the signal is emitted twice so i get the name of the folder twice...

i don't know what signal to connect... can i do something with properties? any idea will be usefull... :)

share|improve this question

1 Answer 1

up vote 2 down vote accepted

A gtk.FileChooserButton implements the gtk.FileChooser interface. This means you can just use those methods on your button. get_current_folder() is probably the one you need.

share|improve this answer
    
which signal is better to connect? for using the gtk.FileChooser i must one, but i have only the gtk.FileChooserButton ... i must create a gtk.FileChooser in glade and then use the builder.get_object() ? –  Clepto Jul 7 '12 at 21:43
    
You don't need to create a gtk.FileChooser, the gtk.FilechooserButton implements its interface, which means you can use those methods, signals and properties. Do you really need signals? Usually you just retrieve the selected folder with the above mentioned get_current_folder() method. –  Timo Jul 7 '12 at 22:33
    
you are right! thanks! –  Clepto Jul 8 '12 at 7:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.