Reputation: 97
I've seen that it is possible to bind a label to a function so that if it's clicked, it does something. How can this be done using canvas.create_image
method? When I tried it says that AttributeError: 'int' object has no attribute 'bind'
. How is an image an integer?
Upvotes: 2
Views: 1060
Reputation: 13729
Use the canvas.tag_bind method.
img = canvas.create_image()
canvas.tag_bind(img, '<Button-1>', callback)
Upvotes: 3