2012-06-25 93 views
1

我正在使用“快速”创建应用程序,并且我想将Webkit小部件添加到我的窗口中。我认为“应该很容易”,但是一如既往,这不是那么容易。导入WebKit会导致应用程序在启动时失败。

从我添加import webkit开始,应用程序无法启动。

[email protected]:~/Ubuntu One/Python/gtkreddit$ quickly run 
/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 

整个源代码可以找到here。我正在讨论的具体文件是this one

回答

5

看来你在混合绑定。如果你已经在使用GObject Introspection,那就留下来。尝试:

from gi.repository import WebKit 

或使用旧的绑定为GTK(pygtk)。

相关问题