[Tkinter-discuss] Stopping a for loop with a sleep() funciton in it

Cameron Laird Cameron at phaseit.net
Sun Jul 13 21:19:17 CEST 2008


On Thu, Jul 10, 2008 at 10:35:03PM -0700, Alexnb wrote:
			.
		[hundreds of lines]
			.
			.
> I am not that familiar with teh after call, but when I change it to this:
> 
> def Open(root):
> 
>     bb = BusyBar(root, text='Grabbing Definitions')
>     bb.pack(side=LEFT, expand=NO)
>         
>     bb.on()
>     root.update_idletasks()
>     
>     def sleeper():
>         root.update()
>         root.after(100000000, sleeper())
>         
>     sleeper()
> 
> (notice the () after sleeper in after). It gives me this error. regardless
> of the number in after. Anyways, I get this error
> 
>  root.update()
> RuntimeError: maximum recursion depth exceeded
			.
			.
			.
Alex, I'm lost as to what your current status is--what
you see as solved, and what questions still remain.
Do you see why the fragment above is unlikely to make
you happy?  after()'s second argument names a function;,
it doesn't expect the coder to invoke it.  Does the 
self-scheduling in <URL:
http://tkinter.unpythonic.net/wiki/after > make sense?
How did it not serve you better to write

     root.after(100000000, sleeper)

than what you have above?


More information about the Tkinter-discuss mailing list