Jul-12-2021, 07:31 PM
You can avoid using global and keep a reference to the image on the button object.
photo1 = tk.PhotoImage(file="imgs/math/1.png") btn = tk.Button(exam_started,image=photoimage1) btn.pack() btn.photo1 = photo1