'why my horizontal scrollbar does not go below the table?
I am trying to add horizontal and vertical scrollbars to my Treeview table. this is the part of my code related to this problem. My question is why it does not bring the horizontal scrollbar below the Treeview table?
from tkinter import ttk
from tkinter import *
new_window = Tk()
new_window.geometry("400x400")
new_window.resizable(False, False)
frame1 = LabelFrame(new_window)
frame1.pack(fill="both", expand=False)
tree = ttk.Treeview(frame1, height=3)
tree.pack(side="left")
# Vertical Scrollbar
vsb = ttk.Scrollbar(frame1, orient="vertical", command=tree.yview)
vsb.pack(side="right", fill="y")
# Horizontal Scrollbar
hsb = ttk.Scrollbar(frame1, orient="horizontal", command=tree.xview)
hsb.pack(side="bottom", fill="x")
tree.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
new_window.mainloop()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
