Hi all,
Following is a piece of code which tries to open an image using Tkinter, the root window opens but I am not able to see the image. I don't know what is wrong with my implementation.
Could you please have a look at the code & see if I am missing something?
from tkFileDialog import *
import Image, ImageTk,Pmw, Tkinter
class Demo:
def __init__(self, parent):
notebook = Pmw.NoteBook(parent)
notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
page_4 = notebook.add('About')
pg4_group = Pmw.Group(page_4, tag_text = 'Picture')
pg4_group.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
image = Image.open("pic.JPG")
photo = ImageTk.PhotoImage(image)
label = Tkinter.Label(pg4_group.interior(),image=photo)
label.place(x=0,y=0,width=image.size[0],height=image.size[1])
if __name__ == '__main__':
root = Tkinter.Tk()
Pmw.initialise(root)
widget = Demo(root)
root.mainloop()
Thanks,