GNOME Bugzilla – Bug 622882
Add override for TreeModel
Last modified: 2010-06-29 20:19:06 UTC
Patch attached which adds overrides for Gtk.TreeModel.get_iter() and Gtk.TreeMode.get_iter_first(), replicating the API of PyGTK. Test case included.
Created attachment 164736 [details] [review] Add override for TreeModel Closes: bgo
Created attachment 164743 [details] [review] Add override for TreeModel Implements get_iter(), get_iter_first() and __len__(). Closes: bgo#622882
Comment on attachment 164736 [details] [review] Add override for TreeModel Note that I wasn't able to run the tests, since I have no idea which paths to use. I thought I ran them before, but apparently not. The overrides seem to work for Totem's Python plugins though, so the tests should run fine.
This should be fixed by adding the (out) annotation for API's that take caller allocated tree iters in GTK+. I've avoided it until now but since others want this functionality it seems that we should add it now.
(In reply to comment #4) > This should be fixed by adding the (out) annotation for API's that take caller > allocated tree iters in GTK+. I've avoided it until now but since others want > this functionality it seems that we should add it now. Ah, that makes sense. What about __len__ though?
(Bug #623068 filed about adding the annotations to GTK+.)
__len__ would need the override. Please post another patch with just ___len__ without the fixes to existing iter api (I'm going to go in and fix all of that once I review and commit your GTK+ patch)
Created attachment 164900 [details] [review] Add override for TreeModel implementing __len__()
Comment on attachment 164900 [details] [review] Add override for TreeModel implementing __len__() Looks good. Please commit
commit daca09dc2c2306d4fa82a68bbdd147d4b170a1e7 Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Tue Jun 29 16:37:36 2010 +0100 Add override for TreeModel implementing __len__() Closes: bgo#622882 gi/overrides/Gtk.py | 11 +++++++++-- tests/test_overrides.py | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-)