]> granicus.if.org Git - python/commitdiff
Remove some redundant code from Canvas.tag_bind(), which added all
authorGuido van Rossum <guido@python.org>
Fri, 30 Jul 1999 12:22:12 +0000 (12:22 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 30 Jul 1999 12:22:12 +0000 (12:22 +0000)
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)

Lib/lib-tk/Tkinter.py

index 3eeee5c11b6b0ed88fe4ecc19d6c0c807b3d5992..8d06ef16a57cfe82f9a32df0f344ffbe1402cc96 100644 (file)
@@ -1158,7 +1158,6 @@ def At(x, y=None):
                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 @@ class Canvas(Widget):
                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))