How can I set the size of a window with tkinter?

T

Tor Erik Sønvisen

Hi

I create a canvas that is to big for the default window-size, so it gets cut
to fit...
How can I increase the window-size to make sure the canvas fits?

regards tores
 
F

Fredrik Lundh

Tor said:
I create a canvas that is to big for the default window-size, so it gets cut to fit...

what default window size? what geometry management approach are
you using?

(if you're using pack or grid, your toplevel window should adapt itself
to the canvas size, unless you're using an obnoxious window manager.
if you do, Tkinter may not be able to do much about that...)

</F>
 
I

Iain King

Tor said:
Hi

I create a canvas that is to big for the default window-size, so it gets cut
to fit...
How can I increase the window-size to make sure the canvas fits?

regards tores

root=Tk()
root.minsize(300,300)
root.geometry("500x500")

will limit the window to be at least 300x300, and set it straight away
to 500x500.

Iain
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top