bind

Liste des GroupesRevenir à cl tcl 
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


Date Sujet#  Auteur
7 Apr 25 * bind4Manfred Stelzhammer
7 Apr 25 `* Re: bind3Harald Oehlmann
7 Apr 25  `* Re: bind2Manfred Stelzhammer
7 Apr 25   `- Re: bind1Manfred Stelzhammer

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal