(Python 2.4.1, tcl/tk 8.4 on Linux)
I try to create a widget class (Frame2 in the example)
containing a Listbox.
This should report an event '<<ElementSelect>>'
when the Listbox produces '<<ListboxSelect>>'
or when the selection changes using the Up/Down keys.
(see example script)
Binding '<<ElementSelect>>' to the Frame2 widget
produces the following traceback when the
event is generated:
------------------
listbox select
event generated
Traceback (most recent call last):
File "testevent.py", line 98, in ?
tk.mainloop ()
File "/usr/local/lib/python2.4/lib-tk/Tkinter.py",
line 965, in mainloop
self.tk.mainloop(n)
File "/usr/local/lib/python2.4/lib-tk/Tkinter.py",
line 1349, in __call__
self.widget._report_exception()
File "/usr/local/lib/python2.4/lib-tk/Tkinter.py",
line 1112, in _report_exception
root = self._root()
AttributeError: Tk instance has no __call__ method
-----------------
So Tkinter tries to report an exception
caused by the event, but fails to do so
by a second exception in _report_exception.
(not quite sure I did understand this)
The first exception may be a problem with
my code or tcl/tk but at least the second
is a problem of Tkinter.
If you bind '<<ElementSelect>>' to Tk itself
the example works fine.
|