images in anygui

Dennis Godfrey <[email protected]> Wed, 20 Oct 2004 14:14:20 -0700 (PDT)
Newsgroups gmane.comp.python.anygui.general
Message-ID <[email protected]>
I am new to anygui. I very much like the speed at which
I am able to develop an interface and the size of the code.
Tkinter is what I have used in the past.

I have a question. Looked in the archives, perhaps I missed it.

I would like to include an image in my app, but have not
figured out the right magic and incantations to do so. :)

I have something like this...hopefully, there is enough to
get the idea of what I am trying to accomplish. I don't get
any errors, but on the Frame, I see the word Label. Can someone
pull the mud from my eyes? Thanks, tons!


from anygui import *
import Image, ImageTk

class MainFrame:

   def __init__( self, parent ):

      self.filename = 'gnome-unknown.png'
      self.file = Image.open(self.filename)
      self.image = ImageTk.PhotoImage(self.file)
      self.theScan = Label(image = self.image, position = (225, 200))
      fMain.add(self.theScan)
      win.add(fMain, hmove = 1)

app = Application()
win = Window(size = ( 650, 475 ))
app.add(win)

fMain = Frame(frameOpt)
MainFrame(fMain)

app.run()



dennis - have gudulka, will travel
http://KafanaKlub.com




-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl