mercredi 6 avril 2022

How can we know Checkbox from tree-view hierarchy to print path in shell environment?

from ttkwidgets import CheckboxTreeview
import tkinter as tk

root = tk.Tk() 
tree = CheckboxTreeview(root)
tree.pack()

tree.insert("", "end", "1", text="1")
tree.insert("1", "end", "11", text="11")
tree.insert("1", "end", "12",  text="12")
tree.insert("11", "end", "111", text="111")
tree.insert("", "end", "2", text="2")

root.mainloop()

How to display the path in the shell when I tick one or more checkboxes?

For example, I click 111, I would like to see it prints 1/11/11 on the shell




Aucun commentaire:

Enregistrer un commentaire