It’s possible to get the row item that was double-clicked in a treeview widget.
# First, setup the double-click binding for your treeview widget.my_treeview.bind("<Double-1>",on_treeview_double_clicked)
Function to run when an item is double-clicked
1 2 3 4 5 6 7 8 91011121314151617181920
defon_treeview_double_clicked(event):# Get all selected itemsselected_items=my_treeview.selection()# Make sure a row is selectedifnotselected_items:returnelse:# Get the first selected itemitem_iid=selected_items[0]# Get a dictionary of details for the selected row.item_details=my_treeview.item(item_iid)# Get displayable text from the rowitem_text=item_details.get("text")item_values=item_details.get("values")print(item_text,item_values)