I have inserted items into a Python treeview with tag option.
tree.insert("", 'end', 'item1', text='item1', tags=('new',))
Is it possible to change the tag "new" to something else later?
You can modify any of the options of an item. So if you want to change 'item1' tags to for example 'old':
tree.item('item1', tags=('old'))
From Python docs about ttk.Treeview:
item(item, option=None, **kw) Query or modify the options for the specified item.
If no options are given, a dict with options/values for the item is returned. If option is specified then the value for that option is returned. Otherwise, sets the options to the corresponding values as given by kw.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With