how to UNSELECT row in a ttk.Treeview in tkinter

半城伤御伤魂 提交于 2019-12-11 02:47:11

问题


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


回答1:


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

treeview.selection_clear()


来源:https://stackoverflow.com/questions/45376198/how-to-unselect-row-in-a-ttk-treeview-in-tkinter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!