Sujet : bind De : manfred (at) *nospam* antispam.at (Manfred Stelzhammer) Groupes :comp.lang.tcl Date : 07. Apr 2025, 17:51:42 Autres entêtes Organisation : A noiseless patient Spider Message-ID :<vt0vqv$77mg$1@dont-email.me> User-Agent : Mozilla Thunderbird
Hi I have a small script. #### script start toplevel .top pack [frame .top.f] pack [entry .top.f.en] bind .top <Button-1> "tuwas b1 %W" bind .top <Down> "tuwas down %W" proc tuwas {cmd W} { puts "$cmd : $W" if {$W ne ".top.f"} { if {$cmd eq "b1"} {event generate .top.f <Button-1> } if {$cmd eq "down"} {event generate .top.f <Down> } } } #### script end If I press the mouse-button on .top.f.en I get two outputs: b1 : .top.f.en b1 : .top.f That's was I expected. If I on .top.f.en and I press <Down> I get many (501) outputs: down : .top.f.en down : .top.f.en down : .top.f.en I get an error: "error: too many nested evaluations (infinite loop?)"
I expected I get: down : .top.f.en down : .top.f If I press <Down> on .top.f the proc tuwas should generate a event on .top.f not on .top.f.en Why this different behavior? What do I wrong? reagards Manfred