GNOME Bugzilla – Bug 660798
No way to have a GtkTextIter as a prop
Last modified: 2011-10-10 09:27:16 UTC
SSIA see i.e http://git.gnome.org/browse/gedit/tree/plugins/snippets/snippets/windowactivatable.py#n31
Looking at the propertyhelper file, the method that errors out checks for standard Python types and GObject/GEnum types. A Gtk.TextIter however is a GBoxed type. I'll attach a possible patch, without really testing. But the GBoxed type has a __gtype__ method too.
Created attachment 198130 [details] [review] Allow GBoxed types as property
It does not work for me: Gtk-Message: Failed to load module "canberra-gtk-module" Traceback (most recent call last):
+ Trace 228674
from windowactivatable import WindowActivatable
class Activate(Gedit.Message):
super(GObjectMeta, cls).__init__(name, bases, dict_)
cls._install_properties()
gproperties[name] = prop.get_pspec_args()
raise NotImplementedError(ptype)
Created attachment 198204 [details] [review] Allow GBoxed types as property This should be the correct patch. Tested on Ubuntu 11.10 which includes a very recent version of PyGobject.
Review of attachment 198204 [details] [review]: Looks good to me too. You need an ack from J5 or tomeu too. Maybe provide an unit test for it?
Testing setting and getting such a property is needed so we don't regress. Once you have such a test case, run "make check-valgrind" and check this doesn't introduce memory errors.
Created attachment 198592 [details] [review] boxed tests And here it is the tests for it.
I pushed http://git.gnome.org/browse/pygobject/commit/?id=bef8d385117dd0295c9ba7567710d76fc2bb729a which uses GRegex instead of Gtk.TextIter.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.