Re: strange behavior in bind

From: Brian Denheyer <briand_at_deldotd.com>
Date: Tue, 9 Mar 1999 13:13:40 -0800 (PST)

>>>>> "Erick" == Erick Gallesio <eg_at_unice.fr> writes:

    Erick> I'm not sure to understand. Can you send please a piece of
    Erick> code which exhibit the incorrect behavior?

Well of course - I should have done that in the first place ! BTW, I
did look through the source code to see what might be the problem but
I saw nothing which made me understand what might be happening.

Also I looked through the "actual" Tk man-page and can't seem to find
anything there either.

The example code works as follows :

Simply moving the mouse works "normally". If you press shift while
moving the mouse, motion1 is invoked and you will see that the
coordinates reported back seems to be 10x what they are supposed to
be. Notice that the only difference is the name of the arguments, x
and y as compared to xc and yc. Of course it might be that 0 is being
appended to the results. Either way it's very strange...


Brian

------------------------------------------------
(require "Tk-classes")

(define c (make <canvas>))

(pack c)

(define motion
  (lambda (x y)
    (format #t "~A, ~A\n" x y)))

(define motion1
  (lambda (xc yc)
    (format #t "~A, ~A\n" xc yc)))

(bind c "<Motion>" motion)
(bind c "<Shift-Motion>" motion1)
Received on Tue Mar 09 1999 - 22:15:24 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST