pythontkinterttk

how to UNSELECT row in a ttk.Treeview in tkinter


Once I click into a ttk.Treeview() and select a row, I can click another row but there is no way for me to deselect all the rows, there will always be at least 1 row selected.

Is there a clever way to allow unselecting the last selected row?


Solution

  • Change the name of your var i use treeview=ttk.Treeview() and put in a button [UNSELECT ALL] the following code:

    treeview.selection_clear()