By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

Tk: filling a frame with a widget

P: n/a
I have this code

from Tkinter import *

root=Tk()
Button(root).pack(fill=BOTH)
root.mainloop()

I would expect the button filling all the client draw area of the
Frame, but when I resize the root window the button becomes wider, but
not higher ( I get some empty space under the button). How could set
the button to fill always all the space available?

Well maybe some other solution exists, since my problem is this:

I have a resizable window and i want to keep it filled with a Canvas
displaying an image (PhotoImage). Can I get the in some way the size
of the clien draw area of the window containig the canvas?

Thnx
PAolo

--
if you have a minute to spend please visit my photogrphy site:
http://mypic.co.nr
Oct 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Paolo Pantaleo wrote:
I have this code

from Tkinter import *

root=Tk()
Button(root).pack(fill=BOTH)
root.mainloop()

I would expect the button filling all the client draw area of the
Frame, but when I resize the root window the button becomes wider, but
not higher ( I get some empty space under the button). How could set
the button to fill always all the space available?

Well maybe some other solution exists, since my problem is this:

I have a resizable window and i want to keep it filled with a Canvas
displaying an image (PhotoImage). Can I get the in some way the size
of the clien draw area of the window containig the canvas?

Thnx
PAolo

--
if you have a minute to spend please visit my photogrphy site:
http://mypic.co.nr
you also need to expand it as in
from Tkinter import *

root=Tk()
Button(root).pack(expand=1,fill=BOTH) #HERE use expand=1 as extra
option
root.mainloop()

jean-marc

Oct 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.