Mailing List Archive

Help: Tkinter, bad event type
Hi

I'm running Python 1.5.2c1 under Win NT with SP4 and Tcl/Tk 8.05. When I
try to run any script that uses Tkinter, even hello.py from the Tkinter
Life Preserver, I get two identical error messages:

bad event type or keysym "MouseWheel"
while executing "bind Listbox <MouseWheel> ..." invoked from
<Tk library path>/listbox.tcl
...
invoked from <Tk library path>/tk.tcl

I can work around this by editing listbox.tcl and commenting out the
"bind Listbox <MouseWheel> ..." statement, but I have to do this every
time I install a new version of Tcl/Tk, and it's annoying.

The same thing happened when I downloaded Python 1.5.2b2, and allowed
the installer to install Tcl/Tk. I have tried downloading a fresh copy
of Tcl/Tk and reinstalling it, but the problem persists.

Tk scripts work fine without the modifying of listbox.tcl, so it seems
to be a problem in the interface between Python and Tk.

Any help would be appreciated

Yours

Marten Hedman
Centre for Biotechnology
Turku, Finland
Help: Tkinter, bad event type [ In reply to ]
<Marten.Hedman@btk.utu.fi> wrote:
> I'm running Python 1.5.2c1 under Win NT with SP4 and Tcl/Tk 8.05. When I
> try to run any script that uses Tkinter, even hello.py from the Tkinter
> Life Preserver, I get two identical error messages:
>
> bad event type or keysym "MouseWheel"
> while executing "bind Listbox <MouseWheel> ..." invoked from
> <Tk library path>/listbox.tcl
> ...
> invoked from <Tk library path>/tk.tcl

I've not used Python or Tkinter, but that message appears when a
pre-8.0.4 Tk library tries to evaluate the initialization scripts
distributed with Tk 8.0.4 or later. Can you check the value of
the Tcl variable 'tk_patchLevel' to see for sure that your apps
are using matching versions of the Tk library and the initialization
scripts? Perhaps they're linking to an earlier version of the Tk
shared library which is somewhere on your system? Perhaps there's
an old tk80.dll in your .../Windows/System area?

> I can work around this by editing listbox.tcl and commenting out the
> "bind Listbox <MouseWheel> ..." statement, but I have to do this every
> time I install a new version of Tcl/Tk, and it's annoying.

Rather than comment out, wrap these statements (there's also one
in text.tcl) in code which tests the value of the global variable
tk_patchLevel, and evaluates the MouseWheel binding only if
tk_patchLevel reports that the Tk library 8.0.4 or later is in use.

...but you still have to do that for every new 8.0.x release of
Tk unless you can convince Scriptics to fix this bug. To report
it to them, use their WWW Bug Report Form:

http://www.scriptics.com/support/bugForm.tcl

--
| Don Porter, D.Sc. Mathematical and Computational Sciences Division |
| donald.porter@nist.gov Information Technology Laboratory |
| http://math.nist.gov/mcsd/Staff/DPorter/ NIST |
|______________________________________________________________________|
Help: Tkinter, bad event type [ In reply to ]
MÃ¥rten Hedman <Marten.Hedman@btk.utu.fi> wrote:
> I'm running Python 1.5.2c1 under Win NT with SP4 and Tcl/Tk 8.05. When I
> try to run any script that uses Tkinter, even hello.py from the Tkinter
> Life Preserver, I get two identical error messages:
>
> bad event type or keysym "MouseWheel"
> while executing "bind Listbox <MouseWheel> ..." invoked from
> <Tk library path>/listbox.tcl
> ...
> invoked from <Tk library path>/tk.tcl
>
> I can work around this by editing listbox.tcl and commenting out the
> "bind Listbox <MouseWheel> ..." statement, but I have to do this every
> time I install a new version of Tcl/Tk, and it's annoying.

looks like you pick up the wrong Tcl/Tk DLL's when running
Python. better double-check your installation.

</F>
Help: Tkinter, bad event type [ In reply to ]
Many thanks to both Don and Fredrik for their prompt answers to my
question. I searched my system an found old versions of both tk80.dll
and tcl80.dll in C:\winnt\system32. When I deleted them, my python
scripts worked fine.

Thanks again.

Marten Hedman
Centre for Biotechnology
Turku, Finland