【问题标题】:Importing WebKit causes application to fail at start-up.导入 WebKit 会导致应用程序在启动时失败。
【发布时间】:2012-06-25 17:32:22
【问题描述】:

我正在使用 Quickly 制作一个应用程序,并且我想在我的窗口中添加一个 Webkit 小部件。 我想“应该很容易”,但和往常一样,它不可能那么容易。

从我添加 import webkit 的那一刻起,应用程序无法启动。

robin@RobinJ:~/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

【问题讨论】:

    标签: python webkit gtk pygtk canonical-quickly


    【解决方案1】:

    看来您正在混合绑定。如果您已经在使用 GObject Introspection,请继续使用它。试试:

    from gi.repository import WebKit
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-15
      • 2018-06-15
      • 2011-05-25
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      • 2020-04-19
      • 1970-01-01
      相关资源
      最近更新 更多