Hi Kevin,

Kevin:  I can't reproduce the issue in Python 2.7 (I don't have 3.x on
my system) nor can I reproduce it when run directly from Tk. The
equivalent Tk code:

Mick:    On my own Mac, the code works on 2.7.3 but not 3.2.
This was also reported by someone back in 2011.

Ned's comments on bugs.python explain why this is
the case:  (http://bugs.python.org/issue10731)

To quote Ned:

It looks like the problem is that the current Cocoa Tcl/Tk 8.5.x
returns an incorrect MouseWheel event.  Using the supplied test
program and breakpointing in PythonCmd (around Modules/_tkinter.c:2027
in default), I found that it is being called from Tcl for MouseWheel
events with an "argc" of 20, which looks suspiciously like the length
of argv[1], "4302153816mouse_wheel", rather than the number of
arguments which should be more like 3.  It may also be an issue that
affects Python because _tkinter still uses the older Tcl_CreateCommand
interface rather than the newer Tcl_CreateObjCommand.  The same Tcl
behavior is observed with Python 2.7 _tkinter.c but there the bogus
arguments are translated using PyString_FromString which is unaffected
by the garbage arguments.  It might be possible to workaround this
problem in _tkinter but the next step is to open a Tcl/Tk issue
against the Cocoa implementation and push for a proper fix there.

Mick
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to