In my small tkinter app I have tree with such scructure as in the picture below. I want to make click event only when user will double click to last item of the tree (Amount1 or Amount2 etc.) Unfortunatly click event works when I click any item of the tree. How fix this behavior?!
CODE:
self.treeView.insert('', 'end', "parent", text=text)
first_child = self.treeView.insert("parent", 'end', text=text)
second_child = self.treeView
second_child.insert(first_child, 'end', "", text=text)
second_child.bind("<Double-1>", self.OnDoubleClick)
def OnDoubleClick(self, event):
item = second_child.identify('item', event.x, event.y)
print("you clicked on", second_child.item(item, "text"))
Structure of the tree: