from tkinter import *
from tkinter import ttk
root = Tk()
root.geometry("400x400+30+150")
ttk.Label(root,text="line1").grid(row=1,column=1)
ttk.Label(root,text="line2").grid(row=1,column=3)
ttk.Label(root,text="line3").grid(row=3,column=1)
ttk.Label(root,text="line4").grid(row=3,column=3)
sh = ttk.Separator(root, orient=HORIZONTAL)
sh.grid(row=2,column=1,columnspan=3,sticky="we")
sv = ttk.Separator(root, orient=VERTICAL)
sv.grid(row=1,column=2,rowspan=3,sticky="ns")
root.columnconfigure(1,weight=1)
root.rowconfigure(1,weight=1)
root.columnconfigure(3,weight=1)
root.rowconfigure(3,weight=1)
root.mainloop()
分割线实例
最新推荐文章于 2024-06-26 15:35:08 发布