在发布之前,我确实搜索了很多示例,但仍然无法正确使用tkinter网格。我想要的是:我的代码:import tkinter as tkfrom tkinter import ttkroot = tk.Tk()b1 = ttk.Button(root, text='b1')b1.grid(row=0, column=0, sticky=tk.W)e1 = ttk.Entry(root)e1.grid(row=0, column=1, sticky=tk.EW)t = ttk.Treeview(root)t.grid(row=1, column=0, sticky=tk.NSEW)scroll = ttk.Scrollbar(root)scroll.grid(row=1, column=1, sticky=tk.E+tk.NS)scroll.configure(command=t.yview)t.configure(yscrollcommand=scroll.set)root.columnconfigure(0, weight=1)root.columnconfigure(1, weight=1)root.rowconfigure(1, weight=1)root.mainloop()
添加回答
举报
0/150
提交
取消