Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 421bb0e

Browse files
committed
fix canvas bind commands
1 parent 6d6a15b commit 421bb0e

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/lib-tk/Canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def bbox(self):
5252
x1, y1, x2, y2 = self.canvas.bbox(self.id)
5353
return (x1, y1), (x2, y2)
5454
def bind(self, sequence=None, command=None):
55-
return self.canvas.bind(self.id, sequence, command)
55+
return self.canvas.tag_bind(self.id, sequence, command)
5656
def config(self, cnf=None):
5757
return self.canvas.itemconfig(self.id, cnf)
5858
def coords(self, pts = ()):

Lib/lib-tk/Tkinter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def bbox(self, *args):
951951
def tag_unbind(self, tagOrId, sequence):
952952
self.tk.call(self._w, 'bind', tagOrId, sequence, '')
953953
def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
954-
return self._bind((self._w, 'tag', 'bind', tagOrId),
954+
return self._bind((self._w, 'bind', tagOrId),
955955
sequence, func, add)
956956
def canvasx(self, screenx, gridspacing=None):
957957
return self.tk.getdouble(self.tk.call(

Lib/tkinter/Canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def bbox(self):
5252
x1, y1, x2, y2 = self.canvas.bbox(self.id)
5353
return (x1, y1), (x2, y2)
5454
def bind(self, sequence=None, command=None):
55-
return self.canvas.bind(self.id, sequence, command)
55+
return self.canvas.tag_bind(self.id, sequence, command)
5656
def config(self, cnf=None):
5757
return self.canvas.itemconfig(self.id, cnf)
5858
def coords(self, pts = ()):

Lib/tkinter/Tkinter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def bbox(self, *args):
951951
def tag_unbind(self, tagOrId, sequence):
952952
self.tk.call(self._w, 'bind', tagOrId, sequence, '')
953953
def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
954-
return self._bind((self._w, 'tag', 'bind', tagOrId),
954+
return self._bind((self._w, 'bind', tagOrId),
955955
sequence, func, add)
956956
def canvasx(self, screenx, gridspacing=None):
957957
return self.tk.getdouble(self.tk.call(

0 commit comments

Comments
 (0)