nur es funktioniert leider nicht wie erwartet und ich weis auch nicht woran es liegen könnte.
Trotzdem tippe ich auf die Funktionen das dort ein Fehler drin ist.
Ich brauche da bei hilfe vielen Dank in Vorraus.
Code:
Code: Alles auswählen
#!/usr/bin/env python
from Tkinter import *
root = Tk()
def enter(event): #Problem bild verschwindet
path2 = "image2.gif"
bilddatei2 = PhotoImage(file=path2,width=100,height=100)
bild["image"] = path2
def leave(event): #Problem bild kommt nicht zurück
path = "image1.gif"
bilddatei = PhotoImage(file=path,width=100,height=100)
bild["image"] = path
path = "image1.gif"
bilddatei = PhotoImage(file=path,width=100,height=100)
#Das funktioniert und zeigt Bild 1 an
bild = Label(image=bilddatei)
bild.pack()
root.mainloop()