[Python-checkins] CVS: python/dist/src/Lib/lib-tk Canvas.py,1.14,1.15
Guido van Rossum
python-dev@python.org
Thu, 5 Oct 2000 17:38:55 -0700
Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory slayer.i.sourceforge.net:/tmp/cvs-serv32398
Modified Files:
Canvas.py
Log Message:
[ Bug #110677 ] PRIVATE: various minor Tkinter things (PR#388)
http://sourceforge.net/bugs/?func=detailbug&group_id=5470&bug_id=110677
Canvas.CanvasItem & Canvas.Group:
- bind lacks an optional "add" param
- unbind lacks an optional "funcid" param
- tkraise/lower should call self.canvas.tag_XXXX
(markus.oberhumer@jk.uni-linz.ac.at)
Note: I'm *not* fixing "bbox() return value is inconsistent with
Canvas.bbox()" -- it might break existing code.
Index: Canvas.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Canvas.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Canvas.py 1998/07/16 13:43:05 1.14
--- Canvas.py 2000/10/06 00:38:51 1.15
***************
*** 1,4 ****
--- 1,7 ----
# This module exports classes for the various canvas item types
+ # NOTE: This module was an experiment and is now obsolete.
+ # It's best to use the Tkinter.Canvas class directly.
+
from Tkinter import Canvas, _cnfmerge, _flatten
***************
*** 42,49 ****
x1, y1, x2, y2 = self.canvas.bbox(self.id)
return (x1, y1), (x2, y2)
! def bind(self, sequence=None, command=None):
! return self.canvas.tag_bind(self.id, sequence, command)
! def unbind(self, sequence):
! self.canvas.tag_bind(self.id, sequence, '')
def config(self, cnf={}, **kw):
return self.canvas.itemconfig(self.id, _cnfmerge((cnf, kw)))
--- 45,52 ----
x1, y1, x2, y2 = self.canvas.bbox(self.id)
return (x1, y1), (x2, y2)
! def bind(self, sequence=None, command=None, add=None):
! return self.canvas.tag_bind(self.id, sequence, command, add)
! def unbind(self, sequence, funcid=None):
! self.canvas.tag_unbind(self.id, sequence, funcid)
def config(self, cnf={}, **kw):
return self.canvas.itemconfig(self.id, _cnfmerge((cnf, kw)))
***************
*** 67,75 ****
self.canvas.insert(self.id, beforethis, string)
def lower(self, belowthis=None):
! self.canvas.lower(self.id, belowthis)
def move(self, xamount, yamount):
self.canvas.move(self.id, xamount, yamount)
def tkraise(self, abovethis=None):
! self.canvas.tkraise(self.id, abovethis)
raise_ = tkraise # BW compat
def scale(self, xorigin, yorigin, xscale, yscale):
--- 70,78 ----
self.canvas.insert(self.id, beforethis, string)
def lower(self, belowthis=None):
! self.canvas.tag_lower(self.id, belowthis)
def move(self, xamount, yamount):
self.canvas.move(self.id, xamount, yamount)
def tkraise(self, abovethis=None):
! self.canvas.tag_raise(self.id, abovethis)
raise_ = tkraise # BW compat
def scale(self, xorigin, yorigin, xscale, yscale):
***************
*** 143,150 ****
def bbox(self):
return self.canvas._getints(self._do('bbox'))
! def bind(self, sequence=None, command=None):
! return self.canvas.tag_bind(self.id, sequence, command)
! def unbind(self, sequence):
! self.canvas.tag_bind(self.id, sequence, '')
def coords(self, *pts):
return self._do('coords', pts)
--- 146,153 ----
def bbox(self):
return self.canvas._getints(self._do('bbox'))
! def bind(self, sequence=None, command=None, add=None):
! return self.canvas.tag_bind(self.id, sequence, command, add)
! def unbind(self, sequence, funcid=None):
! self.canvas.tag_unbind(self.id, sequence, funcid)
def coords(self, *pts):
return self._do('coords', pts)
***************
*** 168,176 ****
return self.canvas.itemconfigure(self.tag, _cnfmerge((cnf,kw)))
def lower(self, belowThis=None):
! self._do('lower', belowThis)
def move(self, xAmount, yAmount):
self._do('move', xAmount, yAmount)
def tkraise(self, aboveThis=None):
! self._do('raise', aboveThis)
lift = tkraise
def scale(self, xOrigin, yOrigin, xScale, yScale):
--- 171,179 ----
return self.canvas.itemconfigure(self.tag, _cnfmerge((cnf,kw)))
def lower(self, belowThis=None):
! self._do('tag_lower', belowThis)
def move(self, xAmount, yAmount):
self._do('move', xAmount, yAmount)
def tkraise(self, aboveThis=None):
! self._do('tag_raise', aboveThis)
lift = tkraise
def scale(self, xOrigin, yOrigin, xScale, yScale):