[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: Tk events
From: John Grayson <johngrayson () home ! com>
Date: 2000-05-31 17:12:41
[Download RAW message or body]
In article <3933F9C6.F67412D8@mitre.org>,
Peter Leveille <psl@mitre.org> wrote:
> Does anyone know what the event name is for catching mouse movement
> without a button pressed? Grayson's book "Python and Tkinter
> Programming" mentions a PointerMotionMask for the Motion event, but I
> can't find any more info on that mask.
>
Peter,
I think Example_6_2.py demostrates this, and the event is also
noted on page 618.
However, this snippet tracks the motion of the mouse without
a button down...
from Tkinter import *
root = Tk()
def motion(event):
print 'Mouse: x=%d, y=%d' % (event.x, event.y)
frame = Frame(root, width=250, height=250)
frame.bind('<Motion>', motion)
frame.pack()
root.mainloop()
John
Sent via Deja.com http://www.deja.com/
Before you buy.
--
http://www.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic