Tkinter question
Fredrik Lundh
fredrik at pythonware.com
Thu Jul 22 04:18:21 EDT 1999
Gary Herron <gherron at aw.sgi.com> wrote:
> > I've got a tkinter canvas, and I want to get it's width.... I call
> >
> > w = int( thecanvas.cget("width") )
> >
> > this works fine.. except when I resize the window, this still returns
> > the width that the canvas was when it was created.. the canvas is
> > getting resized (it has a visible background color)..
> >
> > any ideas?
> >
> > joel
> >
> > --
> > ----------------------------------------------------------------
> > joeld at anisci.com
>
> Use
>
> thecanvas.winfo_width()
>
> This works for any widget, not just canvas.
>
> Here's a list of all the winfo_... methods, taken from Tkinter.py:
...
and here's the documentation:
http://www.pythonware.com/library/tkinter/introduction/basic-widget-methods.htm
</F>
More information about the Python-list
mailing list