Pygtk FileChooser multiple_selection

I'am trying to implement a fileChooser widget.The problem I am facing is, when you select multiple files and hit return or space the selection deselects, except one file. Because of this, when I handle the "file-activated" signal and use get_filenames(), it only returns one filename.

This is my code:

def file_chooser_box2(self):
    box = gtk.HBox(False, 0)

    file_ = gtk.FileChooserWidget()
    file_.set_current_folder("/home/marco")
    file_.set_show_hidden(False)
    file_.set_select_multiple(True)

    file_.connect("file-activated", self.files_selected, file_.get_filenames())

    #hide stuff
    file_box = file_.get_children()[0].get_children()[0].get_children()[1].get_children()[0]
    file_box.hide()


    box.pack_start(file_, True, True, 0)

    file_.show()
    box.show()
    return box

def files_selected(self, widget, data = None):
    print data

Answers


Managed to find a way around.It might help someone.The way I solved the issue is by connecting to the "changed" signal of the treeselection and remebering the last two selections. Now when you hit enter you don't take the changed selection but you take the previous one you remembered.


Need Your Help

Qt C++ Custom Slot

c++ qt signals-slots slot qpushbutton

I'm having trouble with making custom slots in Qt. Code:

(Urban airship) How can I remove(or update) previous push message alert?

android cordova push

My app service is android app using phonegap and push alarm service is one of the app services.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.