An extension's event binding doesn't work
Status: Beta
Brought to you by:
kbk
in config-extensions.def, <Key-Escape> is binded to
CallTips' calltip-cancel event.
It doesn't work - open a shell window, and type 'dir('.
A yellow tip is displayed, but it you press the Escape
button, it doesn't go away.
It does go away if you click the shell window with the
mouse, which is, I think, because the <ButtonPress>
event is also binded to calltip-cancel.
I'm using Debian woody, Python 2.2.1 with IDLEfork from
the CVS.
Logged In: YES
user_id=679426
This is because another function is already binded to the
event <Key-Escape>, and Tk only calls one function per event.
I wrote a module (called MultiCall) with a function which
returns a class which inherits from a Tk widget, but wraps
the event-handling methods so that all the matching
functions will be called for each event, not just the most
specific one. It works great for me, and integrates into
IDLE very easily (a change of two lines).
I already changed the ParenMatch extension to utilize this
(and enhanced it a little), and I'm about to rewrite the
CallTips extension so that it will provide attribute
completion in the spirit of Visual C++, and use a smart
Python parsing (the parsing part I already wrote).
I hope I didn't spam you too much (at least it's better than
the horses),
Noam