0
我试图显示一个窗口与tkinter有一个框架占据整个底部行。Tkinter框架占据整个窗口的底部行
这里是因为我有它现在的代码:
import openpyxl, PIL.Image, sys
from tkinter import *
class App(object):
def __init__(self, root):
self.root = root
w, h = root.winfo_screenwidth() * .9, root.winfo_screenheight() * .9
root.geometry("%dx%d+0+0" % (w, h))
root.title('Squirrel Project')
root.wm_iconbitmap('Squirrel.ico')
buttonFrame = Frame(root, width = w, height = 25, padx = 15, pady = 15, bg = 'blue')
buttonFrame.pack(fill = X, expand = True, side = BOTTOM)
saveButton = Button(buttonFrame, text = 'Save', command = self.save).pack(side = LEFT)
与上面的代码中,帧占据窗口的整个宽度,但中间一行。如果我从buttonFrame.pack
中删除fill = X, expand = True
,那么该帧将占据底行,但只占其一部分。我怎样才能让框架占据整个底部?