'Python's scroll bar isn't moving

I want my scrollbar is moving when I scroll.

import tkinter
import tkinter.ttk

window=tkinter.Tk()
window.title("debug")
window.geometry("640x400+200+200")
window.resizable(1, 1)                                                     

frame=tkinter.Frame(window)
scrollbar=tkinter.Scrollbar(frame)
scrollbar.pack(side="right", fill="y")

treeview=tkinter.ttk.Treeview(frame, columns=["#1", "#2"], displaycolumns=["#1", "#2"])      
treeview.pack()
treeview.column("#0", width=100, anchor="center")
treeview.heading("#0", text="Sequence", anchor="center")                       
treeview.column("#1", width=150, anchor="center")
treeview.heading("#1", text="name", anchor="center")                      
treeview.column("#2", width=150, anchor="center")
treeview.heading("#2", text="connect", anchor="center")                  
treeview["height"] = "20"                                         
treelist=[("","")]                                                           
test_list=[                                                                   
    [["1","1"],["1","1"]],    
    [],                                                                       
    [["2","2"]],
    [["3","3"],["3"],["3", "3"]],
    [["7400 1","4600 2"]],
    [["4","4a"],["4","4b"],["4","4c"]],
    [["4","4a"],["4","4b"],["4","4c"]],
    [["4","4a"],["4","4b"],["4","4c"]],
    [["4","4a"],["4","4b"],["4","4c"]],
    [["4","4a"],["4","4b"],["4","4c"]]
    ]
for i in range(1,len(test_list)+1):
    top=treeview.insert('', 'end', text=str(i), iid=(str(i)+"번"))
    for j in range(len(test_list[i-1])):
        top_mid1=treeview.insert(top, 'end', text=(str(i)+'-'+str(j+1)), values=test_list[i-1][j], iid=(str(i)+"-"+str(j+1)))


scrollbar["command"]=treeview.yview
frame.pack()
window.mainloop()

However, the scrollbar has stopped. Then force down the scrollbar with a mau, and it will go up again.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source