Try this:
pack [label .l -textvar COORDS] -fill x
bind all <Motion> { set COORDS "X: %X, Y: %Y" }
No weird while loop necessary.
--
Jeffrey Hobbs office: 541.683.7891
Nomad of the 'Net email: jho...@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~jhobbs/
I want to write an application where a toolbar will appear when the mouse
is moved to the extreme right of the screen. So far I've written the
following tcl application which tracks where the mouse is and displays the
x and y coordinates in a window.
Unfortunately, the application only seems to track the mouse when the mouse
is in the tcl/tk window that displays the coordinates. How can I track
the mouse position throughout the whole screen? eMail assistance appreciated.
#!/usr/bin/wish
set X 0
set Y 0
label .l -text "X $X, Y $Y"
pack .l
bind all <Motion> { set X %X; set Y %Y }
while {$X == $X} {
.l configure -text "X $X, Y $Y"
update
}
Thanks,
Richard Mundell
--
--- Richard Mundell
---- r.mu...@uea.ac.uk
----- http://www.sys.uea.ac.uk/~u9427082
Jeffrey Hobbs (jho...@cs.uoregon.edu) wrote:
: In article <55lh1k$d...@cpca4.uea.ac.uk>,
: Richard Mundell# <u942...@cpca4.uea.ac.uk> wrote:
: >Unfortunately, the application only seems to track the mouse when the mouse
: >is in the tcl/tk window that displays the coordinates. How can I track
: >the mouse position throughout the whole screen? eMail assistance appreciated.
: Try this:
: pack [label .l -textvar COORDS] -fill x
: bind all <Motion> { set COORDS "X: %X, Y: %Y" }
: No weird while loop necessary.
pointerxy()