For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2004 > [bind] and multiple event handlers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [bind] and multiple event handlers
Googie

2004-10-14, 4:00 pm

Hi!

I'm trying to set 2 different handlers for one event, by the following:

bind $w <Enter> "puts {it's an enter}"
bind $w <Enter> +"puts {this is the second handler for enter}"

but I got error message: "extra characters after close-bracket", so
I've tried to replace line
bind $w <Enter> +"puts {this is the second handler for enter}"
with line
bind $w <Enter> +"; puts {this is the second handler for enter}"
but it haven't hepled.
Any hints?

--
Pozdrawiam (Greetings)!
Googie
Ramon Ribó

2004-10-14, 4:00 pm

Hello,

Try:

bind $w <Enter> "puts {it's an enter}"
bind $w <Enter> "+puts {this is the second handler for enter}"

or:

bind $w <Enter> [list +puts {this is the second handler for enter}]

Regards,

--
Ramon Ribó
http://gatxan.cimne.upc.es/ramsan

"Googie" <googie@no.spam.org> escribió en el mensaje
news:cklrn3$fup$1@atlantis.news.tpi.pl...
> Hi!
>
> I'm trying to set 2 different handlers for one event, by the following:
>
> bind $w <Enter> "puts {it's an enter}"
> bind $w <Enter> +"puts {this is the second handler for enter}"
>
> but I got error message: "extra characters after close-bracket", so
> I've tried to replace line
> bind $w <Enter> +"puts {this is the second handler for enter}"
> with line
> bind $w <Enter> +"; puts {this is the second handler for enter}"
> but it haven't hepled.
> Any hints?
>
> --
> Pozdrawiam (Greetings)!
> Googie



Rufus V. Smith

2004-10-21, 4:04 pm


"Googie" <googie@no.spam.org> wrote in message
news:cklrn3$fup$1@atlantis.news.tpi.pl...
> Hi!
>
> I'm trying to set 2 different handlers for one event, by the following:
>
> bind $w <Enter> "puts {it's an enter}"
> bind $w <Enter> +"puts {this is the second handler for enter}"
>
> but I got error message: "extra characters after close-bracket", so
> I've tried to replace line
> bind $w <Enter> +"puts {this is the second handler for enter}"
> with line
> bind $w <Enter> +"; puts {this is the second handler for enter}"
> but it haven't hepled.
> Any hints?
>
> --
> Pozdrawiam (Greetings)!
> Googie


Does it work as a single bracketed element, e.g.

bind $w <Enter> {puts {it's an enter}; puts {this is the second handler for
enter}}

?




Sektor van Skijlen

2004-10-21, 4:04 pm

Dnia Thu, 21 Oct 2004 11:02:01 -0400, Rufus V. Smith skrobie:

> "Googie" <googie@no.spam.org> wrote in message
> news:cklrn3$fup$1@atlantis.news.tpi.pl...
[color=darkred]
> Does it work as a single bracketed element, e.g.


> bind $w <Enter> {puts {it's an enter}; puts {this is the second handler for
> enter}}


> ?


This maybe works, but only in theory. In practice, when you bind two handlers
for one event, you do this in separate, far from each other, places. This
solution would never fit for it - will you read current setting and append new
parts of code?



--
// _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `| /^\ ,() <ethourhs(O)wp.pl>
// \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
"Java does not have pointers!"
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com