I am creating a small program that should display an image overlayed the main window based on a button click event. However, whenever I test the code that should be doing this, I get this error: AttributeError: 'int' object has no attribute '_create'
Here is the appropriate code:
def display_image(event):
fail_image = tk.PhotoImage(file="./RedXMark.png")
Canvas.create_image(0, 0, image=fail_image, anchor="nw")
# Later in the code:
root.bind('<t>', display_image)
I have been trying to use Tkinter's labels to display the image and, while I wouldn't get an error, it wouldn't display the image. The image is in the same folder as the program and is saved with that exact name.
Any advice would be welcome!