GNOME Bugzilla – Bug 679999
can't initialize 'Gtk.TreeModelFilter' with a model
Last modified: 2012-07-16 14:36:54 UTC
I've heard that Gtk.TreeModelFilter.new(model) was working before, but I get 'TreeModelFilter' has no attribute 'new' in current git. magcius said on IRC that this is because is incorrectly parsed, we have model.filter_new(). gtk_tree_model_filter_new takes a GtkTreeModel as its first argument, it's treated as Gtk.TreeModel.filter_new .
*** Bug 679998 has been marked as a duplicate of this bug. ***
Indeed, and calling Gtk.TreeModel.filter_new does not work either, so I think we can fix this without breaking currently working API: $ python3 -c 'from gi.repository import Gtk; print(Gtk.TreeModel.filter_new(None))' Traceback (most recent call last):
+ Trace 230516
return super(TreeModel, self).filter_new(root)
This needs to be fixed in the GTK annotations, reassigning.
Actually, ignore me. gtk_tree_model_filter_new() is _not_ a constructor of GtkTreeModelFilter, it is indeed a method of GtkTreeModel. You indeed have to call .filter_new(root) on an already existing TreeModel instance.
Thanks Martin, then the pygi-convert.sh script is wrong in this line: -pe "s/self._model.filter_new\(\)/Gtk.TreeModelFilter.new\(self._model, None\)/g;" \
Ah, thanks. Fixed: http://git.gnome.org/browse/pygobject/commit/?id=30935fe31