I don't have ads on this website. Donations help keep this site going.
If you find tkinter-snippets.com useful, please donate any amount you feel comfortable with.
Visit https://ko-fi.com/jobinpy to donate. Thank you!
ttk.Treeview – Delete all items
We can delete all items in a treeview widget, regardless if they’re selected or not.
12345
# Get a tuple of all root-level item iid'sall_root_items=treeview_food.get_children()# Delete all root level items, which will automatically delete all their children too.treeview_food.delete(*all_root_items)