我试图用GTK创建一个多线程。需要Gtk.gdk,但我收到关于没有gdk属性的错误。我在用覆盆子皮和覆盆子。
这就是我如何导入GTK库。
try:
import pygtk
pygtk.require("2.0")
except:
pass
try:
from gi.repository import Gtk
except:
print("GTK Not Available")
sys.exit(1)
Gtk.gdk.threads_init()
这就是我收到的错误。
AttributeError'gi.repository.Gtk' object has no attribute 'gdk'
知道吗?
更新: 我正在学习本教程http://faq.pygtk.org/index.py?req=show&file=faq14.023.htp 它们同时使用GObject.threads_init()&Gtk.gdk.threads_init()。我使用GObject没有问题,但是使用gdk。
目前没有回答
相关问题 更多 >
编程相关推荐