Why does this code display buttons taller than they are wide?
import Tkinter, tkFont
top = Tkinter.Tk()
right = Tkinter.Frame(top)
right.pack(side = "right")
font = tkFont.Font(family="Helvetica", size=60, weight = tkFont.BOLD)
for i in xrange(6):
b = Tkinter.Button(right, text = str(i), font = font, width = 1, height = 1)
top.rowconfigure(i, weight = 1)
top.columnconfigure(i, weight = 1)
b.grid(row = i/3, column = i%3, sticky = "NWSE")
top.mainloop()
- All the buttons are created with
width=1, height=1
- For every row and every column of
right
there is a call toright.rowconfigure(rowi, weight=1)
(or tocolumnconfigure
). - Every grid placement of every button
b
is made with stickyNSEW
. - I have set
right.grid_propagate(0)
What exactly am I doing wrong?
If I put the buttons directly onto top
, the buttons just become wider than tall. It seems that they are being resized to accomodate propagated space. How do I prevent this resizing?