Merhaba, Python da ve Tkinter da oldukça yeniyim 6 farklı buton oluşturup bu butonların üzerinde ki resimleri bastığım zaman değiştirmek istiyorum. Örneğin birinci buton üzerinde sıcaklık_on.png isimli bi resim varken üzerine tıkladığımda sıcaklık_off.png olan bir resimle değişsin istiyorum (aynı şekilde sıcaklık_off.png resmide basınca değişsin) ve bunu 6 buton için yapmaya çalışıyorum her bir butonu oluşturdum ve yanlızca ilk buton için denedim ancak resmi değiştirmek istediğimde butonu yanlızca pencere üzerinden kaldırıyor yeni buton meydana getiremiyorum. Nasıl yapabilirim.
from tkinter import *
pencere = Tk()
pencere.geometry("800x480")
pencere.resizable(width= FALSE, height= FALSE)
def sıcaklık_off():
buton1.destroy()
sıcaklık_off = PhotoImage(file="sıcaklık_off.png")
buton7 = Button(pencere, text="sıcaklık_off", image = sıcaklık_off)
buton7.place(relx=0.33, rely=0.11)
sıcaklık_on = PhotoImage(file="sıcaklık_on.png")
buton1 = Button(pencere, text="sıcaklık_on", image = sıcaklık_on, command= sıcaklık_off())
buton1.place(relx=0.33, rely=0.11)
ısıtıcı_on = PhotoImage(file="ısıtıcı_on.png")
buton2 = Button(pencere, text="ısıtıcı", image = ısıtıcı_on)
buton2.place(relx=0.33, rely=0.11)
lamba_on = PhotoImage(file="lamba_on.png")
buton3 = Button(pencere, text="lamba", image = lamba_on)
buton3.place(relx=0.66, rely=0.11)
titresim_on = PhotoImage(file="titresim_on.png")
buton4 = Button(pencere, text="titresim", image = titresim_on)
buton4.place(relx=0.0, rely=0.56)
kemer_on = PhotoImage(file="kemer_on.png")
buton5 = Button(pencere, text="kemer_belt", image = kemer_on)
buton5.place(relx=0.33, rely=0.56)
servis_on = PhotoImage(file="servis_on.png")
buton6 = Button(pencere, text="servis_on", image = servis_on)
buton6.place(relx=0.66, rely=0.56)
mainloop()