5

I'm trying to integrate my Python/GTK3 app with Ubuntu's messaging menu and every time I try to import "indicate" (python-indicate) my app crashes, with the following traceback:

/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning: g_type_get_qdata: assertion `node != NULL' failed
  from gtk import _gtk

This looks like some sort of clash between GTK2 and GTK3... anyway, how would I go about fixing this?

Thanks.

1 Answer 1

6

Use

from gi.repository import Indicate

instead of

import indicate
3
  • Also check out the PyGI example on developer.ubuntu.com/resources/technologies/… Jun 19, 2012 at 6:05
  • the same thing for vte module: from gi.repository import Vte
    – int_ua
    Jun 20, 2012 at 9:56
  • Same for importing Gdk, GLib, Pango, GdkPixbuf and GObject from gi.repository instead of their older alternatives. It seems it's impossible to import GTK2 and GTK3 at the same time.
    – NoBugs
    Oct 27, 2012 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .