Newbie: question about Tkinter
built4living at excite.com
Fri Feb 28 18:33:36 CET 2003
I am a recreational programmer who has decided to give Python a try.
Up until this point, I have always managed to find a resource that
would help me out when I got into trouble, but not this time. I
recently turned my attention towards tkinter, and I am afraid I am
stumped. I just want to know how to put an image on a canvas. I am
sure I am missing something simple, but can someone help me out? TIA.
This is what I have:
from Tkinter import *
def __init__(self, master=None):
img = PhotoImage(file='test.gif')
self.canvas = Canvas(self, height=200, width=300, bg='white')
self.canvas.create_image (10, 10, image=img)
app = Application()
When I run this, I get the frame and the canvas, but nothing on it.
What am I missing?
More information about the Python-list