【发布时间】:2021-12-14 00:58:54
【问题描述】:
我一直在尝试为 Python 中的 tkinter 树视图附加一个垂直滚动条。 由于某种原因,它显示在 TreeView 下而不是右侧。
TreeView 在框架中
fFetchActivity = LabelFrame(root, text="Spis Twoich Aktywności", padx=50, pady=15)
fFetchActivity.place(x=20, y=200)
以及 TreeView 和滚动条代码:
tv1 = ttk.Treeview(fFetchActivity)
tv1.pack()
scrollbar_object = Scrollbar(fFetchActivity, orient="vertical")
scrollbar_object.pack(side=RIGHT, fill=Y)
scrollbar_object.config(command=tv1.yview)
tv1.configure(yscrollcommand=scrollbar_object.set)
有人对如何改进有任何想法吗? 谢谢!
【问题讨论】:
标签: python tkinter treeview scrollbar