Search code examples
pythontkintertreeview

How to clear an entire Treeview with Tkinter


My program uses a ttk.Treeview as a table and fills it with many numbers.

I want to clear the ttk.Treeview when I press a button in the window.

Is there a simple way to clear the ttk.Treeview?

Thanks.


Solution

  • Ok, I found. I post the answer if someone need an answer to my question :

    for i in tree.get_children():
        tree.delete(i)