I have a Tkinter canvas and bound a mouse button press event to it.
I was wondering if I could figure out on what specific shape a user clicked when bound to a canvas:
def callback(event): pass canvas = Canvas(root, width=100, height=100) canvas.create_rectangle(10,50,40,90, tags="tile") canvas.bind("<Button-1>", callback) I know I can bind it to the the rectangle, the problem is that there might be a another shape overlaying the rectangle and then the click event doesn't work anymore.
I was thinking of using the find_overlapping method:
def callback(event): canvas.find_overlapping(event.x, event.y,event.x, event.y) but was wondering if there is an easier way?

find_enclosedfind_encloseddoes not work bc the shape has to be inside the rectangle created by the points.find_overlappingworks, i was hoping there is an easier way though.'current'for both cases.