How big is that canvas in the window?
rjroy at takingcontrol.com
Mon Aug 27 15:42:27 CEST 2001
On 26 Aug 2001 05:12:52 -0700, koen at behindthesofa.dhs.org (Koen
>Joseph Andrew Knapka <jknapka at earthlink.net> wrote in message news:<3B86C522.169F2868 at earthlink.net>...
>> Bob Greschke wrote:
>> > Here's the idea:
>> > www.passcal.nmt.edu/~bob/unlinked/images/trdpy.jpg
>> > It's in Python/Tkinter. See the "Plot" button? I want to draw a
>> > graph in the black area. How do I find out the dimensions of the
>> > black canvas area??? I can make a guess when I first draw everything
>> > by setting the size of everything, but I don't want to do that. I
>> > want the user to be able to resize the window and then redraw the
>> > graph. I got to exactly this same point in GTK+ and had to give up.
>> > Am I going to have to write this program in Java?? :-)
>> > (The program is actually being written for/on a UNIX box. I just had
>> > to use a Windows machine to get the screen dump.)
>> > Thanks!
>>>> from Tkinter import *
>>>> root = Tk()
>>>> canv = Canvas(root)
>Section "Basic Widget Methods"
>Please bookmark this site: a lifesaver when programming with Tkinter.
See also winfo_width, winfo_height. In some circumstances, I have
found these to be more reliable than cget('width"), and cget("height")
also you might want to try using PMW
It has nice megawidgets including a scrolled canval
More information about the Python-list