[Tkinter-discuss] Re: Listbox selection issue
Michael Lange
klappnase at web.de
Tue Apr 20 06:52:26 EDT 2004
On Mon, 19 Apr 2004 23:26:26 +0200
"Fredrik Lundh" <fredrik at pythonware.com> wrote:
> Michael Lange wrote:
>
> > # where the corner of the listbox is relative to the screen:
> > x_org = self.listbox.winfo_rootx()
> > y_org = self.listbox.winfo_rooty()
> > # where the pointer is relative to the listbox widget:
> > x = event.x_root - x_org
> > y = event.y_root - y_org
>
> any reason you cannot just do
>
> x = event.x
> y = event.y
>
> ?
>
> </F>
Oops!
Thanks, not really, it seems.
The reason I did so was that I "stole" the whole part of the function you quoted
(including the comments) from someone who used it in a canvas widget without
thinking very much about it and adapted it for my listbox method; well, at least
the complicated way works, too;-)
Best regards
Michael
More information about the Tkinter-discuss
mailing list