Problem with Tkinter's scale function.

Nicholas Feinberg nick.feinberg at gmail.com
Tue Feb 10 02:36:36 EST 2009


Not the widget, the function in Canvas. So far as I can tell, integer values
for scale work fine; you can scale something to a factor of 2, 3, 17, etc.
Float values for scale - such as you might use if you were, say, trying to
scale a rectangle to half its current size - also work, insofar as the
targets of the scale-function are resized. The problem is that, in addition
to this resizing, they're sent hurtling off the canvas with remarkable
speed; rightwards if there's a float for the x-scale, downwards if there's a
float for the y-scale, bottom-rightwards if both are floats. It's
entertaining, but rather unhelpful.

Code that caused the problem (unlikely to be helpful, but no reason not to
include it):
self.canvas.scale(self.body,self.radius/(self.radius-.5),self.radius/(self.radius-.05),0,0)#radius
is greater than .5

Running Python 2.6 on Vista.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090209/edb13bef/attachment.html>


More information about the Python-list mailing list