【发布时间】:2021-08-23 06:21:44
【问题描述】:
这是我的代码
from tkinter import *
root = Tk()
myframe = Frame(root, bg="red")
myframe.pack()
btn1 = Button(myframe, text="Button 1", font="Comicsans 15 bold")
btn1.grid(row=0, column=0)
btn2 = Button(myframe, text="Button 2", font="Comicsans 15 bold")
btn2.grid(row=0, column=1)
root.grid_columnconfigure((0, 1), weight=1)
root.mainloop()
如何让grid_columnconfigure() 工作?
【问题讨论】:
-
将
root.grid_columnconfigure更改为myframe.grid_columnconfigure
标签: python user-interface tkinter interface