[Tkinter-discuss] Sizing

Jeff Cagle jrcagle at juno.com
Sun Dec 24 22:42:45 CET 2006

This is an ignorant question, so thanks in advance for your patience.

I'm trying to code a card game, and I have lots of little .gif's used to 
display card images as follows:

from Tkinter import *
import Image, ImageTk
class Card(object):

  def display(self, canvas, x, y, angle)
     im = Image.open(self.URL)
     im = im.rotate(angle)
    self.image = ImageTk.PhotoImage(im)


The idea is to show four hands of 13 cards, each hand facing inwards.

Oddly, when I display them, the right hand gets truncated.  The 
dimensions of the canvas print out as 265x378.  I can fix it by 
assigning height and width of the canvas manually, but it made me 
wonder: why doesn't the canvas autosize?

Jeff Cagle

More information about the Tkinter-discuss mailing list