[Tkinter-discuss] Stumped
Bob Greschke
bob at greschke.com
Tue Nov 28 19:06:34 CET 2006
Adding the ----- lines seems to work.
> from Tkinter import *
> import time
>
> def on_button():
> for J in range(10):
> print J
> if CancelNow:
> break
> time.sleep(1)
------ Root.update()
>
> def Cancel(Event):
------ global CancelNow
> print 'Cancelling now'
> CancelNow = True
> Root.quit()
>
> Root = Tk()
> Root.bind_all('<Key-Escape>',Cancel)
>
> B = Button(Root,command=on_button,text='Go')
> B.pack()
> CancelNow = False
>
> Root.mainloop()
More information about the Tkinter-discuss
mailing list