On Mon, Jan 5, 2009 at 9:09 AM, pellegrini <pellegr...@ill.fr> wrote: > Hello everybody, > > I have a problem with the grid management. > > Here is the following simple script: > > ###################################################################### > from Tkinter import * > root = Tk() > f = Frame(root) > f.grid(row = 0, column = 0, sticky = W) > > f1 = Frame(f, relief = GROOVE, bd = 2) > f1.grid(row = 0, column = 0, sticky = W) > str1 = StringVar(root,'%-20s' % 'Label') > Label(f1, textvariable = str1, anchor = W).grid(row = 0, column = 0, sticky > = W) > Button(f1, text = 'Button1').grid(row = 0, column = 1) > > f2 = Frame(f, relief = GROOVE, bd = 2) > f2.grid(row = 1, column = 0, sticky = W) > str2 = StringVar(root,'%-20s' % 'BiggerLabel') > Label(f2, textvariable = str2, anchor = W).grid(row = 0, column = 0, sticky > = W) > Button(f2, text = 'Button2').grid(row = 0, column = 1) > > root.mainloop() > ###################################################################### > > I would expect that script to produce two frames with exactly the same size > but it is not the case. > However the two labels have the same size by construction (i.e. 20). > > Would you have any idea ? >
strings of same length won't give you labels of same size, since that matters nothing when you are not using a monospace font. If you just want frames with same size, change theirs stickys to "ew". > thank you very much > > Eric Pellegrini > > -- -- Guilherme H. Polo Goncalves _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss