How to find out height of a Canvas

Tim Rowe digitig at cix.co.uk
Wed Jun 14 17:31:00 EDT 2000


In article <393da9e6.79611437 at news1.on.sympatico.ca>, 
rjroy at takingcontrol.com (Robert Roy) wrote:

> On Sun, 4 Jun 2000 13:53 +0100 (BST), digitig at cix.co.uk (Tim Rowe)
> wrote:
> 
> >In article <eaq_4.3871$JO2.84543 at news2-win.server.ntlworld.com>, 
> >richard_chamberlain at ntlworld.com (richard_chamberlain) wrote:
> >
> >> Hi Tim,
> >> 
> >> from Tkinter import *
> >> root=Tk()
> >> canvas=Canvas(root,height=250,width=100)
> >> canvas.pack()
> >> print canvas ['height']
> >> 
> >> canvas.itemcget has two arguments, the first is the tag or id of a
> >> particular widget on the canvas and the second is the option you 
> > want >back.
> 
> You might want to look at the winfo_height method. Getting the height
> configuration value is not always accurate.
> 

Ah! Thanks. I was wondering why I was occasionally a pixel out here and 
there. I take it there's a winfo_width method, too.



More information about the Python-list mailing list