Seite 1 von 1

tkinter+bild

Verfasst: Montag 26. Juli 2010, 12:40
von erdmulch
Hallo,

ich habe folgendes Programm:
es wird ohne Fehler mit Eclipse kompiliert, leider erscheint nichts!!
kann mir jemand sagen was ich falsch mache?
das Bild wurde in den richtigen Pfad kopiert!!

import tkinter
cv = tkinter.Canvas(width=200, height=200)
cv.pack()
img = tkinter.PhotoImage(file="Bild.gif")
cv.create_image(0, 0, image=img, anchor="nw")

Re: tkinter+bild

Verfasst: Montag 26. Juli 2010, 12:42
von _narf_
cv.pack() / img.pack()?

Re: tkinter+bild

Verfasst: Montag 26. Juli 2010, 12:53
von busfahrer
Hallo
ich würde sagen dir fehlt

Code: Alles auswählen

cv.mainloop()
Gruß...busfahrer

Re: tkinter+bild

Verfasst: Montag 26. Juli 2010, 13:22
von erdmulch
Ah Danke...
nun geht es

import tkinter
cv = tkinter.Canvas(width=200, height=200)
cv.pack()
img = tkinter.PhotoImage(file="Bild.gif")
cv.create_image(0, 0, image=img, anchor="nw")
cv.mainloop()