Re: Tkinter: how; newbie
- From: "Matimus" <mccredie@xxxxxxxxx>
- Date: 13 Feb 2007 15:44:24 -0800
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/
.
- Follow-Ups:
- Re: Tkinter: how; newbie
- From: Gigs_
- Re: Tkinter: how; newbie
- References:
- Tkinter: how; newbie
- From: Gigs_
- Tkinter: how; newbie
- Prev by Date: Re: multiple inheritance of a dynamic list of classes?
- Next by Date: Re: What does "del" actually do?
- Previous by thread: Tkinter: how; newbie
- Next by thread: Re: Tkinter: how; newbie
- Index(es):
Relevant Pages
|