ttk.Treeview – Delete selected items

We can delete the selected items in a treeview widget using the .delete() method.

img

1
2
3
4
5
# Get all selected items.
selected_items = treeview_food.selection()

# Delete all the selected items.
treeview_food.delete(*selected_items)