PythonGUI TKinter(一)
–学习猿地(新版全套Python基础教程(下) #GUI编程)
Frame框架
相当于web框架中的div 容器
不写width和height属性的时候默认为无,及只有一个点
import tkinter
# 复选框组件
root = tkinter.Tk()
root.geometry('500x500')
# 创建组件
f1 = tkinter.Frame(root, bg='red', width=200, height=200)
f1.pack()
f2 = tkinter.Frame(root, bg='blue', width=200, height=200)
f2.pack()
root.mainloop()
如果把按钮放到frame中可以形成类似网格排列的方式,但是不推荐使用
来源:CSDN
作者:Jocker_Tong
链接:https://blog.csdn.net/Weary_PJ/article/details/104106990