On Nov 2, 2007, at 6:32 PM, Kevin Walzer wrote:

> [EMAIL PROTECTED] 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.


I'm not certain exactly what you're saying. Are you saying to install  
Active State's Python? It looks like that doesn't include a new Tk  
Aqua. Or are you saying to install Active State's Tcl? I'm not certain  
how installing the latter by itself will change which Tk my Python uses.

I think I figured out a work around. Instead of first clicking on the  
Tk window's title bar to move it, first click inside the Tk window to  
make it active, then use the title bar to move it, and then clicks  
seem to respond with the correct coordinate.

Thanks,
Dave

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to