Remove some redundant code from Canvas.tag_bind(), which added all
bindings to a dictionary _tagcommands which was otherwise unused.
(This was checked in accidentally with rev. 1.125 and not deleted with
rev. 1.127 when the other half of this code was removed -- although
even as originally checked in the _tagcommands variable was never
used.)
(PR#40, reported by Peter Stoehr)
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 3eeee5c..8d06ef1 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -1158,7 +1158,6 @@
return '@' + `x` + ',' + `y`
class Canvas(Widget):
- _tagcommands = None
def __init__(self, master=None, cnf={}, **kw):
Widget.__init__(self, master, 'canvas', cnf, kw)
def addtag(self, *args):
@@ -1185,16 +1184,8 @@
if funcid:
self.deletecommand(funcid)
def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
- res = self._bind((self._w, 'bind', tagOrId),
- sequence, func, add)
- if sequence and func and res:
- # remember the funcid for later
- if self._tagcommands is None:
- self._tagcommands = {}
- list = self._tagcommands.get(tagOrId) or []
- self._tagcommands[tagOrId] = list
- list.append(res)
- return res
+ return self._bind((self._w, 'bind', tagOrId),
+ sequence, func, add)
def canvasx(self, screenx, gridspacing=None):
return getdouble(self.tk.call(
self._w, 'canvasx', screenx, gridspacing))