Tcl: "image does not exist" problem
Matthew Dixon Cowles
matt at mondoinfo.com
Sun Sep 16 21:17:34 CEST 2001
On Sun, 16 Sep 2001 20:59:29 +0200, Janos Blazi <jblazi at hotmail.com>
>I have the following (naive) line in a Tkinter program:
>and get the error message in the subject line.
>After that I took a look in the book by Grayson and saw that things
>are more complicated. Can anybody show me what to do?
The image parameter wants an image object. For a GIF image, can use
Tkinter's PhotoImage class. I'll append a simple example.
If you haven't had a look at it already, Fredrik Lundh's excellent An
Introduction to Tkinter is also a great help when doing Tkinter
programming. It's at:
I generally keep a local copy open when I'm doing Tkinter programming.
Fredrik also kindly makes available the Python Imaging Library which
(among other useful things) has a PhotoImage class that understands
various image formats that Tkinter's doesn't. It's at:
from Tkinter import *
# We must keep extra reference to the image due
# to a limitation in Tkinter so we'll make it
# an attribute of our object.
More information about the Python-list