GNOME Bugzilla – Bug 639173
AttributeError: 'gi.repository.Gdk' object has no attribute 'Drawable'
Last modified: 2011-01-11 15:25:00 UTC
>>> from gi.repository import Gdk >>> Gdk.threads_enter() Traceback (most recent call last):
+ Trace 225479
self._import()
overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
class Drawable(Gdk.Drawable):
self.__name__, name))
Using gir1.2-gtk-2.0 version 2.23.90-0ubuntu2 on Ubuntu Natty.
I confirm this on current upstream git head of gtk-2-24.
If GdkDrawable isn't in the .gir any more, there's nothing that PyGObject can do. Please check if GdkDrawable is present in the .gir and if it isn't and it should be, move this bug to either the gtk+ module or gobject-introspection.
Also, note that currently we are not aiming to support gtk+ 2.x in pygobject, only gtk+ 3. So I'm closing this bug accordingly. If people want to use gtk+ 2 with pygobject and introspection, we'll need help maintaining that combination.
It is in the .gir: <class name="Drawable" c:symbol-prefix="drawable" c:type="GdkDrawable" parent="GObject.Object" abstract="1" glib:type-name="GdkDrawable" glib:get-type="gdk_drawable_get_type" glib:type-struct="DrawableClass"> I recently did some commits to gtk-2-24 to improve usage with GI, and it actually works pretty well now. I'll have a look at this RSN.
Funnily enough this _does_ work with current Gtk 2-24 head, but not with Gtk 2.93.7. /usr/share/gir-1.0/Gdk-3.0.gir doesn't contain Drawable at all, i. e. not just introspectable="0". Evan, try >>> from gi.repository import Gdk >>> Gdk.require_version('2.0') >>> Gdk.threads_enter()
Indeed, that works.
(In reply to comment #5) > Funnily enough this _does_ work with current Gtk 2-24 head, but not with Gtk > 2.93.7. /usr/share/gir-1.0/Gdk-3.0.gir doesn't contain Drawable at all, i. e. > not just introspectable="0". Yes, GdkDrawable has been removed from gtk+ 3.
This got fixed in git head: http://git.gnome.org/browse/pygobject/commit/?id=4d097eea94258eda0c328711491fd456cbd6741b Evan, I'll update our pygobject to a recent git snapshot. Thanks!