Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Emergency Bind Question!!

0 views
Skip to first unread message

John Paul Campbell

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to

I'm trying to bind multiple tags in a text widget. I'm doing it like so:

.tx.text tag bind $linkCount <Button-1> {
gotoNewSite $Site
}

This is called repeatedly as linkCount is incremented and Site changes. However,
what happens is that all the tags end up being bound to the last binding
that is done. That is, tags 0 1 2 3 4 5 are all bound to the value of Site when
tag 5 is bound.

If anyone can help me, please email me ASAP as I'm working with a deadline here
at school and no one can answer me.

Thanks in advance.

John

--
------------------------------
John P. Campbell
http://www.owlnet.rice.edu/~jpc
j...@rice.edu
j...@zgs.com

"Potential means you ain't done it yet."
--Bum Phillips

Andreas Truemper

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to John Paul Campbell

In article <53ig5s$e...@listserv.rice.edu>, j...@rice.edu (John Paul Campbell) writes:
|> I'm trying to bind multiple tags in a text widget. I'm doing it like so:
|>
|> .tx.text tag bind $linkCount <Button-1> {
|> gotoNewSite $Site
|> }
|>
|> This is called repeatedly as linkCount is incremented and Site changes. However,
|> what happens is that all the tags end up being bound to the last binding
|> that is done. That is, tags 0 1 2 3 4 5 are all bound to the value of Site when
|> tag 5 is bound.

Hi,
This happens, because the command bound to Button-1 is evaluated when it is invoked. At this
time the variable Site have the last value you used.
Try using



.tx.text tag bind $linkCount <Button-1> " gotoNewSite $Site"

instead.

Bye,
Andreas

--------------------------------------------------------------------------
(~~~~) Andreas Truemper Universitaet Dortmund /////
| | phone +49 231 755-2495 Lehrstuhl Informatik IV ____UNI DO
|C--OO D-44221 Dortmund \\*\\////
| P Email: true...@ls4.informatik.uni-dortmund.de \\\\\//
|____| Snail: Andreas Truemper
|____\* Dernerstr. 37
| \_/ 59174 Kamen
Germany
--------------------------------------------------------------------------

0 new messages