Stumped by PhotoImage issue

Joe joekm at
Tue Feb 26 13:22:11 EST 2002

I've actually seen that there are others with a similar problem that
have posted on the web.  I've read G.R's FAQ and looked at the
solutions others have used but I am still confused.....

In a program that I am writing, I have an "about" dialog box that is
written as a class that is in turned called from the "help : about"
pulldown menu item in my "menubar" class.  This "about" dialog has
three .gif images that are handled by PhotoImage.  The problem is that
they appear to be displaying transparant.

Now, if I pull the class out of my main program and wrap a minimalist
mainloop around it, everything works fine.  Also, if I intentionally
put an error in the part of the class that draws the button, the gif's
are drawn without a problem (but I get an error message and the button
does not draw).  

I've tried setting instance variables, global variables, etc. and I'm
running out of ideas.  Any suggestions would be appreciated.  Just so
you know, this is my first original python program and my first real
intro into object oriented programming.  OTOH, I have read everything
I could download and purchased a couple of books on the subject
including "Python and Tkinter Programming".

..and no, I do not wish to use PMW at this time, I wish to gain
experience with Tkinter first.

The class follows (needs to be un-word-wrapped):

class About:

    def __init__(self, parent, GraphicsPath):

        self.parent = parent

        self.deltaLogo = PhotoImage(file=GraphicsPath+'DeltaLogo.gif')
        self.pythonLogo =
        self.tkLogo = PhotoImage(file=GraphicsPath+'TCL-TK_logo.gif')

        AboutDialog = Toplevel(self.parent, relief=RAISED,
        self.AboutBorder = Frame(AboutDialog, relief=GROOVE,

        title = Label(self.AboutBorder, text='Simple Airframe Fracture
Evaluation Tool [SAFE-T]',
                             font=('Ariel', 11, 'bold'))
        title.pack(side=TOP, padx=2, pady=5)
        global Revision_Type, Revision
        version = Label(self.AboutBorder, text=Revision_Type+'
        copyright1 = Label(self.AboutBorder, text='Copyright 200X by
Joseph K. Mooney and')
        copyright1.pack(pady=5) = Label(self.AboutBorder, image=self.deltaLogo) 

        copyright2 = Label(self.AboutBorder, text='ALL RIGHTS
RESERVED\nSee License Agreement for Further Information\n')
        description = Label(self.AboutBorder, text="Programed in
PYTHON - GUI  built with Tkinter")

        self.python = Label(self.AboutBorder, image=self.pythonLogo)

        self.tclTk = Label(self.AboutBorder, image=self.tkLogo)

        self.AboutBorder.pack(fill=X, expand=YES)

        self.OK = Button(self.AboutBorder, text='OK', font=('Arial',
9, 'bold'), command=AboutDialog.destroy), rely=.8, anchor=NW)

More information about the Python-list mailing list