Dean Allen Provins wrote: > Cameron: > > Cameron Laird wrote: >> In article <[EMAIL PROTECTED]>, >> Dean Allen Provins <[EMAIL PROTECTED]> wrote: >> >>> I need to determine the size of a canvas while the process is running. >>> Does anyone know of a technique that will let me do that? >> . >> . >> . >> Does >> >>> import Tkinter >> >>> c = Tkinter.Canvas() >> >>> c.create_oval(13, 51, 80, 130) >> 1 >> >>> c.pack() >> >>> print c.cget("width") >> 284 >> help? >> >> There are actually several different notions of the size of a >> canvas. The example abovve should be a good starting point, >> though. >> >> There's also a mailing list specifically for Tkinter <URL: >> http://tkinter.unpythonic.net/wiki/mailing_20lists >; that >> might interest you. > > I tried the "cget" function, and it returned the width that I had used > when creating the canvas - even though the canvas was wider than that > value at display time (and also after manually resizing the window). > > To your knowledge, is there a method to determine the current dimensions? > > Thanks, > > Dean
Dean, Look at the winfo_* methods of Tkinter widgets, I think the one you want is called winfo_reqheight / winfo_reqwidth or something very similar pydoc Tkinter.Canvas will sort that out Martin -- http://mail.python.org/mailman/listinfo/python-list