[Tkinter-discuss] Can't do proper event binding in a for loop
ozgulfirat at gmail.com
Tue Oct 19 12:19:03 CEST 2010
for loop doesn't work, because in a for loop all events will be bound all at
once, and you will only see the effect of the last binding. You need
something that binds events one by one.
If I were you, I would use the next() method of Python iterators:
2010/10/19 thea_t <siatogia at yahoo.com>
> Hi everyone,
> I've been writing a long GUI in Python using Tkinter. One thing that I
> understand is why I can't bind events to widgets in a loop. In the code
> below, binding works well if I do it manually (commented out code) but not
> in a for loop. Am I doing something wrong?
> http://old.nabble.com/file/p29995174/events.py events.py
> View this message in context:
> Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tkinter-discuss