如何从课程oneThread调用:返回课程乐趣:?如下所示,填写下面写的课程。可能吗?从上面的课程帮助调用课程
class oneThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.start()
def run(self):
print "1"
time.sleep(1)
print "2"
time.sleep(1)
print "3"
self.wTree.get_widget("entryResult").set_text("Done with One.") # How to call from here back to class fun, which of course is below...?
class fun:
wTree = None
def __init__(self):
self.wTree = gtk.glade.XML("main.glade")
self.wTree.signal_autoconnect({"on_buttonOne" : self.one})
gtk.main()
def one(self, widget):
oneThread();
gtk.gdk.threads_init()
do=fun()
或只是通过wTree,如果这就是你所关心的。 – 2010-04-12 21:12:28
我收到一个错误:AttributeError:'oneThread'对象没有属性'wTree' @ dash-tom-bang请给我举个例子。 – wtz 2010-04-12 21:31:07
将上例中'fun'的所有实例重命名为'wTree'。 – 2010-04-12 22:43:32