Steven G
Steven G

Reputation: 17122

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?

Upvotes: 4

Views: 3023

Answers (1)

Rolando Corratge Nieves
Rolando Corratge Nieves

Reputation: 1233

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

treeview.selection_clear()

Upvotes: 8

Related Questions