On Mon, Apr 13, 2009 at 1:22 PM, Gregor Lingl <gregor.li...@aon.at> wrote:
> Wayne Watson schrieb: > >> Sometime ago, one of my posts brought a response brief exchange on event >> handling*. Where might I find more about event handling with respect to the >> keyboard, and particularly with a mouse. In the latter case, I'm interested >> in finding the pixel position of the mouse on a canvas.<snip> > > Easiest way: from Tkinter import * root = Tk() c = Canvas(root, width = 100, height = 100) def clicked(event): print "Clicked at x: %d y: %d" % (event.x, event.y) c.bind("<Button-1>", clicked) root.mainloop() and fire that up. There's also some motion events but I'd have to look them up to recall. HTH, Wayne
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor