Tkinter: how; newbie

Matimus mccredie at gmail.com
Tue Feb 13 18:44:24 EST 2007


> How the callback function get this two number when it has only one
> argument (event)?

It has one argument, event, which is an instance of a class that has
both x and y attributes.

> print "clicked at", event.x, event.y

It doesn't accept the coordinates as separate parameters because every
event binding uses that same signature, even ones for which
coordinates might not make any sense. I recommend you look over the
python tutorial: http://docs.python.org/tut/





More information about the Python-list mailing list