The changes in Misc.destroy do not look right, why are you deleting
commands created by bind_all (for example) from the root window when a
simple widget is destroyed ?
It would make more sense to not apply these changes in Misc.destroy,
instead, Misc.unbind_all would remove commands from the root using
Misc._root.deletecommand and inside Misc._bind it would check if
needcleanup is true or false and decide from where to remove. Also,
given how this needcleanup parameter is used, I suggest renaming it to
widgetcmd, so if it is set 0 it indicates that the command should live
in self._root()._tclCommands. |