[Tkinter-discuss] buttonpress

Jeff Epler jepler at unpythonic.net
Mon Apr 24 21:42:26 CEST 2006

Consider the following program:

def print_event(evt):
    print "Event at", evt.x, evt.y
from Tkinter import *
b = Button()
b.bind("<B1-Motion>", print_event)

Click inside the button, then move the mouse around, including outside the area
of the button.  You'll continue to see the message "Event at ..." printed as
long as the mouse continues moving, until you release the button.


More information about the Tkinter-discuss mailing list