Tkinter canvas size determination

D

Dean Allen Provins

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?

Thanks,

Dean
 
C

Cameron Laird

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
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.
 
D

Dean Allen Provins

Cameron said:
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.

Your suggestion helps immensely. I missed it in Shipman's Tkinter
reference. And thank you for the mail list reference. I'll pursue it.

Regards,

Dean
 
D

Dean Allen Provins

Cameron:

Cameron said:
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
 
M

Martin Franklin

Dean said:
Cameron:



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
 
D

Dean Allen Provins

Martin:

Martin said:
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

Thanks. That is exactly what I needed. I tried it, and it returned the
desired values.

Regards,

Dean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top