其他分享
首页 > 其他分享> > Frame 框架

Frame 框架

作者:互联网

import tkinter as tk

window = tk.Tk()
window.title("daxiangcai's title")
window.geometry('800x400')

tk.Label(window, text='on the window').pack()  # window上的label

frm = tk.Frame(window)  # 主frame
frm.pack()
frmleft = tk.Frame(frm)  # 次frame
frmright = tk.Frame(frm)
frmleft.pack(side='left')
frmright.pack(side='right')

tk.Label(frmleft, text='left frame').pack()  # frame上的label
tk.Label(frmright, text='right frame').pack()

window.mainloop()

 

标签:框架,frame,frm,window,tk,Frame,pack
来源: https://www.cnblogs.com/daxiangcai/p/16448944.html