All pastes #4054 Raw Edit

zerok

public python v1 · immutable
#4054 ·published 2005-01-11 16:08 UTC
rendered paste body
import pygtkpygtk.require("2.0")import gtkimport threading,timeclass MyThread(threading.Thread):	def __init__(self):		threading.Thread.__init__(self)		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)		self.window.connect("destroy",self.win_destroy)		self.button = gtk.Button("LALAL")		self.button.show()		self.window.add(self.button)		self.window.show()	def win_destroy(self,widget,data=None):		gtk.main_quit()	def run(self):		gtk.main()if __name__ == '__main__':	t = MyThread()	t.start()	for i in range(10):		print "Bye"		time.sleep(1)	t.join()