from tkinter import *
info = Tk()
btn = Button(info)
canvas = Canvas(btn)
canvas.create_oval(10, 10, 5, 5, fill="red")
canvas.pack()
But it didn't work well. I want to change the image displayed inside the button whenever the program is run, and the image consists of a simple combination of figures(circles and lines).
So I decided to make image with Canvas.
But making Canvas inside the button looks impossible to me. Is it possible?
im = tkinter.PhotoImage(file="photo.png")
btn = Button(info, image=im)
Image is usually added in the button like this ways, I think.
I confirmed the type of object 'im' is <class 'tkinter.PhotoImage'>.
In a different way, can I make <class 'tkinter.PhotoImage'> object with Canvas or matplotlib, or something?
