import tkinter as tk
from tkinter import ttk

root = tk.Tk()

tree = ttk.Treeview(root,selectmode='browse')
tree.grid()

def cb(event):
    print(tree.selection())
    
tree.tag_bind('cb','<1>',cb)
tree.tag_bind('cb','<<TreeviewSelect>>',cb)
#tree.tag_bind('cb', '<<TreeviewOpen>>', cb)
#tree.tag_bind('cb', '<<TreeviewClose>>', cb)



tree.insert('', 'end', 'widgets', text='Widgets',tags=('cb'))
tree.insert('', 0, 'apps', text='Applications',tags=('cb'))

tree['columns'] = ('size', 'modified')
tree.column('size', width=50, anchor='center')
tree.heading('size', text='Size')
tree.heading('modified', text='Modified')

tree.set('widgets', 'size', '12KB')
tree.set('widgets', 'modified', 'Last week')

tree.insert('', 'end', text='Canvas', values=('25KB Today'),tags=('cb'))
tree.insert('apps', 'end', text='Browser', values=('115KB Yesterday'),tags=('cb'))

root.mainloop()