[Pythonmac-SIG] Python TkAqua, Tkinter bug
Kevin Walzer
kw at codebykevin.com
Fri Nov 2 23:32:57 CET 2007
davelist at mac.com wrote:
> I am not certain where the problem is or who to report it to, but
> there is a bug in TkAqua, Tkinter, or possibly OS X's windowing
> system. I am using a simple module on top of Tkinter for teaching an
> intro programming course. When I click the mouse in the Tkinter
> window, it often reports the wrong coordinates for the click most of
> the time. If I use idle and first click on the Tk Console window and
> then in the graphical window it seems to work. If I don't click in the
> Tk Console window or start Python from the Terminal, it almost always
> reports wrong values.
>
> I am running Leopard now and tried both the built-in Python 2.5 and
> installing the version from python.org. Some of my students who are
> using Tiger report the same issue - I don't recall problems last year
> when using this on Tiger, but it's possible. On Windows, the
> coordinates are always correct.
>
> The graphics.py module built on top of Tkinter is available at:
>
> http://mcsp.wartburg.edu/zelle/python/
>
> A simple example that shows the problem is:
>
> from graphics import *
> win = GraphWin('test', 800, 800)
> pt = win.getMouse()
> print pt.getX(), pt.getY()
>
> After clicking in the top left corner, it is clearly the wrong answer
> (it should be near 0, 0 depending on how accurate your click is).
>
> Any ideas on where the problem is, who to notify, etc.?
>
> Thanks,
> Dave
Are you using the built-in Tk that comes with OS X? It's ancient (8.4.7
on Tiger, and not updated for Leopard). Try installing a more recent
version, such as 8.4.16, from ActiveState and see if that solves the
problem.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
More information about the Pythonmac-SIG
mailing list