I Don't Show The Image In Tkinter
The image doesn't show in Tkinter. The same code work in a new window, but in my class it does not. What could be the problem ? import Tkinter root = Tkinter.Tk class InterfaceA
Solution 1:
You must keep a reference to tr.gif . This means you need to add this line:
imLabel.image = im
After these 2 lines:
im = Tkinter.PhotoImage(file="tr.gif")
imLabel = Tkinter.Label(frPic, image=im)
Other notes:
- Run import Tkinter as Tk instead of what you have done
- Fix this:
root = Tkinter.Tk()(add parentheses) - Change
app = InterfaceApp(None)toapp = InterfaceApp(root) - Remove away
app.title("P")and write inside__init__()thisself.parent.title("P") - Change
app.mainloop()toroot.mainloop()
Post a Comment for "I Don't Show The Image In Tkinter"