Packing of Frames
phillip
phillip at transwitch.co.za
Mon Jul 23 04:39:54 EDT 2001
Hi,
I have two frames(left & right) into which I place names (left) and
vlaues (right).
The left Frame adheres to my constraints but the right expands
vertically beyond my constraints.
I do it thus:
root = Tk()
root.geometry('350x300')
root.leftFrame = Frame(width=150, height=300, bg='gray50',
relief=RAISED, bd=4)
root.rightFrame = Frame(width=200, height=300, bg='gray50',
relief=RAISED, bd=4)
root.setup = ui.getSetupValues()
root.rightFrame.pack(fill=X, side=RIGHT)
root.rightFrame.pack_propagate(0)
root.leftFrame.pack(fill=BOTH)
root.leftFrame.pack_propagate(0)
myRow = 0
for eachKey in root.setup.keys():
l = Label(root.leftFrame, text=string.strip(eachKey),
bg='gray50',anchor=E, justify=RIGHT)
r = Entry(root.rightFrame, bg='gray100', width=200,
relief=GROOVE)
l.grid(row=myRow, sticky=E+W )
r.insert(INSERT, string.strip(root.setup[eachKey]))
r.pack()
root.mainloop()
any ideas?
Phill
More information about the Python-list
mailing list