Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
554 B
2
Indexable
Never
def on_tree_click(self, event):
    x, y = event.x, event.y
    # Get the bounding box of the vertical scrollbar
    scrollbar_bbox = self.tree.bbox("vscroll")
    # Get the bounding box of the right side area after the scrollbar
    right_area_bbox = (scrollbar_bbox[2], 0, self.tree.winfo_width(), self.tree.winfo_height())
    # Check if the click is within the right side area
    if x >= right_area_bbox[0] and x <= right_area_bbox[2] and y >= right_area_bbox[1] and y <= right_area_bbox[3]:
        self.tree.selection_remove(self.tree.selection())
Leave a Comment