Filechooser issues

Mr SZ sk8in_zombi at
Fri Jul 11 21:09:25 CEST 2008

I am using a gtk.filechooser dialog to open and save files.How do I add a filter so that only images are filtered ?I did something like this:

    def get_save_filename(self):
        filename = None
        chooser = gtk.FileChooserDialog("Save File...", self.window,
                                        (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, 
                                         gtk.STOCK_SAVE, gtk.RESPONSE_OK))
    ff = gtk.FileFilter.add_pixbuf_formats()
        response =
        if response == gtk.RESPONSE_OK: filename = chooser.get_filename()
        return filename

Now I get an error when I add ff or a filefilter .The error is :

Traceback (most recent call last):
  File "", line 91, in on_save_as_menu_item_activate
    filename = self.get_save_filename()
  File "", line 231, in get_save_filename
    ff = gtk.FileFilter.add_pixbuf_formats()
TypeError: descriptor 'add_pixbuf_formats' of 'gtk.FileFilter' object needs an argument

The documentation doesn't say anything about an argument to be passed:


" life isn't heavy enough,it flies away and floats far above action"

      Start at the new Yahoo!7 for a better online experience.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list