Tkinter problem in sizing a frame

Joe Potter jm7potter at hotmail.com
Fri Jun 29 11:04:45 EDT 2001


Hello one and all,

In the following code (adopted from "Python and Tkinter Programming") I find that I
can set the minimum size for the root widget. However, I can not seem to tell Tk that
I want two sub-frames each of which I want to take up half the parent frame.

All I get is two sub-frames that take up as much room as need to display the label in
each.

Any ideas?


Regards, Joe Potter



######## start code
################

from Tkinter import *

root = Tk()
root.title('Frame Size')
root.geometry("600x300")

f = Frame(root)
xf = Frame(f, relief=GROOVE, borderwidth=5)
jf = Frame(f, relief=GROOVE, borderwidth=5)

Label(xf, text="You shot him!").pack(side=LEFT, pady=10, expand=YES, fill=Y)
Label(jf, text='heck if I know !??').pack(side=LEFT, padx=10, pady=10)

jf.pack(side=TOP)
xf.pack(side=BOTTOM)
f.pack()

root.mainloop()



More information about the Python-list mailing list