[Python-bugs-list] [ python-Bugs-412682 ] Cannot play solitaire - buggy Canvas.py?

noreply@sourceforge.net noreply@sourceforge.net
Tue, 10 Apr 2001 08:50:14 -0700


Bugs item #412682, was updated on 2001-03-31 03:59
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=412682&group_id=5470

>Category: demos and tools
Group: None
Status: Open
>Priority: 1
Submitted By: Alastair Burt (alburt)
>Assigned to: Guido van Rossum (gvanrossum)
Summary: Cannot play solitaire - buggy Canvas.py?

Initial Comment:
To test tkinter in my newly installed Python 2.0, I
tried Demos/tkinter/guido/soliatire.py. This bombed
with the following message:
Traceback (most recent call last):
  File "solitaire.py", line 637, in ?
    main()
  File "solitaire.py", line 632, in main
    game = Solitaire(root)
  File "solitaire.py", line 570, in __init__
    self.deck.fill()
  File "solitaire.py", line 412, in fill
    self.add(Card(suit, value, self.game.canvas))
  File "solitaire.py", line 295, in add
    card.tkraise()
  File "solitaire.py", line 200, in tkraise
    self.group.tkraise()
  File
"/home/burt/lib/python/lib/python2.0/lib-tk/Canvas.py",
line 177, in tkraise
    self._do('tag_raise', aboveThis)
  File
"/home/burt/lib/python/lib/python2.0/lib-tk/Canvas.py",
line 131, in _do
    return self.canvas._do(cmd, (self.tag,) +
_flatten(args))
  File
"/home/burt/lib/python/lib/python2.0/lib-tk/Tkinter.py",
line 1771, in _do
    return self.tk.call((self._w, name) + args)
TclError: bad option "tag_raise": must be addtag, bbox,
bind, canvasx, canvasy, cget, configure, coords,
create, dchars, delete, dtag, find, focus, gettags,
icursor, index, insert, itemcget, itemconfigure, lower,
move, postscript, raise, scale, scan, select, type,
xview, or yview

I managed to fix this with the following kludge to
Canvas.py:

*** Canvas.py	2001/03/31 10:55:24	1.1
--- Canvas.py	2001/03/31 11:38:12
***************
*** 170,180 ****
  	def config(self, cnf={}, **kw):
  		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):
  		self._do('scale', xOrigin, yOrigin, xScale, yScale)
--- 170,180 ----
  	def config(self, cnf={}, **kw):
  		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):
  		self._do('scale', xOrigin, yOrigin, xScale, yScale


--- Alastair

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-04-10 08:50

Message:
Logged In: YES 
user_id=6380

I bet that demo is broken, not the Canvas module, but I have
no time to fix this before the 2.1 release.

Use PySol if you want to play. :-)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=412682&group_id=5470