Tal Einat <talei...@gmail.com> added the comment:
> What do you think of changing 'ToolTip' to 'Tooltip'? +1, I'll change it. > TclError from widget.destroy suggests that we *might* be able to cleanup > better. The try/except clauses which are hard to test are used since the order in which widgets are destroyed can vary, and I don't know how to properly check whether a widget still exists (so that e.g. unbinding events won't throw an exception). For the on-hover tooltip, events are registered on the "anchor" widget. ISTM these events should be unregistered when the tooltip is destroyed, hence I added that to __del__. Any suggestions for a better cleanup mechanism? >> The TclError exceptions are reproduced by the htest in tooltip.py. > With the code as is? Or if the try-except is removed? Without the try/except. > I [...] would like the popups to respond keyboard (Tab) focus changes as well > as mouse movement focus changes. Looking at the Tk docs, it seems this will require binding properly to the FocusIn and oFocusOut events. This is indeed a separate mechanism. It should be straightforward when bound to a simple widget such as a button. The Calltip class will need to override this since it already implements an appropriate alternative. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33839> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com