mirror of
https://github.com/python/cpython.git
synced 2025-01-22 16:35:16 +08:00
fix canvas bind commands
This commit is contained in:
parent
6d6a15bab2
commit
421bb0e389
@ -52,7 +52,7 @@ class CanvasItem:
|
||||
x1, y1, x2, y2 = self.canvas.bbox(self.id)
|
||||
return (x1, y1), (x2, y2)
|
||||
def bind(self, sequence=None, command=None):
|
||||
return self.canvas.bind(self.id, sequence, command)
|
||||
return self.canvas.tag_bind(self.id, sequence, command)
|
||||
def config(self, cnf=None):
|
||||
return self.canvas.itemconfig(self.id, cnf)
|
||||
def coords(self, pts = ()):
|
||||
|
@ -951,7 +951,7 @@ class Canvas(Widget):
|
||||
def tag_unbind(self, tagOrId, sequence):
|
||||
self.tk.call(self._w, 'bind', tagOrId, sequence, '')
|
||||
def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
|
||||
return self._bind((self._w, 'tag', 'bind', tagOrId),
|
||||
return self._bind((self._w, 'bind', tagOrId),
|
||||
sequence, func, add)
|
||||
def canvasx(self, screenx, gridspacing=None):
|
||||
return self.tk.getdouble(self.tk.call(
|
||||
|
@ -52,7 +52,7 @@ class CanvasItem:
|
||||
x1, y1, x2, y2 = self.canvas.bbox(self.id)
|
||||
return (x1, y1), (x2, y2)
|
||||
def bind(self, sequence=None, command=None):
|
||||
return self.canvas.bind(self.id, sequence, command)
|
||||
return self.canvas.tag_bind(self.id, sequence, command)
|
||||
def config(self, cnf=None):
|
||||
return self.canvas.itemconfig(self.id, cnf)
|
||||
def coords(self, pts = ()):
|
||||
|
@ -951,7 +951,7 @@ class Canvas(Widget):
|
||||
def tag_unbind(self, tagOrId, sequence):
|
||||
self.tk.call(self._w, 'bind', tagOrId, sequence, '')
|
||||
def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
|
||||
return self._bind((self._w, 'tag', 'bind', tagOrId),
|
||||
return self._bind((self._w, 'bind', tagOrId),
|
||||
sequence, func, add)
|
||||
def canvasx(self, screenx, gridspacing=None):
|
||||
return self.tk.getdouble(self.tk.call(
|
||||
|
Loading…
Reference in New Issue
Block a user