I mean replacing *one* of the callbacks for the event. Suposing that I do
not know which callbacks were previously set, except the one I want
remplace. If I *set* a callback, all the callback list will be erased.
This is a case in a plugin system. My plugin want to add a hook, but is
probable that other plugins already hooked they own callbacks. I do no want
to delete they callbacks but just to remplace the "root" callback (for which
I already have a reference).
I did this post because I found strange to do not found a way to do this,
maybe it should be a PEP for Tkinter ?
RodrigoB.
"Eric Brunel" <er*********@N0SP4M.com> escribió en el mensaje
news:br**********@news-reader5.wanadoo.fr...
Rodrigo Benenson wrote: Hi,
I have a weird need in tkinter. If I have a widget I can *set* a binding
.bind("<the event>", the_callback)
I also can *append* a binding
.bind("<the event>", the_second_callback, "+")
but now, I need to *replace* a callback.
What's the difference between "setting" and "replacing" for you? If you
set a callback doing a "return 'break'" at the end, the event should execute
your binding and nothing else. Can you post a script showing exactly what you
want to do and what problems you have?
--
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools -
http://www.pragmadev.com