Images in Tkinter

Viewer T. dtgeadamo at yahoo.com
Fri Jul 20 12:37:17 EDT 2007


I wrote a class in which I have to use Tkinter images. When I create
an image object in the class and reference it with the image attribute
of label within the class, it does not dhow the image. It just shows a
blank label that conforms to the size of the image. My images is a GIF
image.

My code takes the form:
class Login:
     def __init__(self):
          create image object and other things necessary for class
initialisation
          self.make_widgets
     def make_widgets(self):
          Then I create my widgets

Then, I instantiate the login class.

I use Python 2.5. Does anyone have any idea why my imae does not
diplay itself? I have tried using the image before outside a class and
it works! Also, I tried creating the image object outside class but it
gives a runtime error saying it is too early to create an image
object. Please help!




More information about the Python-list mailing list