Hello,<br><br>for loop doesn&#39;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. <br><br>If I were you, I would use the next() method of Python iterators:<br>
<br><a href="http://paste-it.net/public/pe0b871/">http://paste-it.net/public/pe0b871/</a><br><br>Firat<br><br><div class="gmail_quote">2010/10/19 thea_t <span dir="ltr">&lt;<a href="mailto:siatogia@yahoo.com">siatogia@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Hi everyone,<br>
<br>
I&#39;ve been writing a long GUI in Python using Tkinter. One thing that I don&#39;t<br>
understand is why I can&#39;t bind events to widgets in a loop. In the code<br>
below, binding works well if I do it manually (commented out code) but not<br>
in a for loop. Am I doing something wrong?<br>
<br>
<a href="http://old.nabble.com/file/p29995174/events.py" target="_blank">http://old.nabble.com/file/p29995174/events.py</a> events.py<br>
<font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/Can%27t-do-proper-event-binding-in-a-for-loop-tp29995174p29995174.html" target="_blank">http://old.nabble.com/Can%27t-do-proper-event-binding-in-a-for-loop-tp29995174p29995174.html</a><br>

Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Tkinter-discuss mailing list<br>
<a href="mailto:Tkinter-discuss@python.org">Tkinter-discuss@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tkinter-discuss" target="_blank">http://mail.python.org/mailman/listinfo/tkinter-discuss</a><br>
</font></blockquote></div><br>