[Pythonmac-SIG] after

Philippe de Rochambeau philippe at wwphi.net
Fri Mar 26 07:47:26 EST 2004


Hello,

the following tcl/tk code displays a window, then closes it while 
exiting:

#!/usr/bin/wish

button .hello -text Hello \
	-command { puts stdout "Hello World!" }
	pack .hello -padx 20 -pady 20
	
after 3000 destroy .

The equivalent python/tkinter does not work. Any idea why?

#!/usr/bin/python

from Tkinter import *

def hello():
	print "Hello World!"

root = Tk()
Button(root, text='Hello', command=hello).\
pack(padx=20, pady=20)
root.after(3000, root.destroy())
root.mainloop()

# Result : macpython icon appears in Dock for
# several seconds, then quits








-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 686 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040326/2020aba7/attachment.bin


More information about the Pythonmac-SIG mailing list