wPython in Action: example chapter 1

I use IDLE with wxPython and most of the time, the output is spewed into
it. But you can easily use SPE (http://sourceforge.net/projects/spe) as
it's available on Mac. DrPython looks like it might be a possibility since
it runs on Linux (http://drpython.sourceforge.net/ ) And there's always
Eclipse.

More info on picture conversions can be found here:
http://wiki.wxpython.org/index.cgi/WorkingWithImages

The other guys pointed you to the docs. I'm sure Robin will have something
to say as well.

Mike

···

-----Original Message-----
From: 7stud [mailto:bbxx789_05ss@yahoo.com]
Sent: Friday, April 20, 2007 6:07 AM
To: wxpython-users@lists.wxwidgets.org
Subject: wPython in Action: example chapter 1

Can anyone tell me why this doesn't work:

---
import wx

class MyFrame(wx.Frame):
    def __init__(self, img):
        bmap = img.ConvertToBitmap()
        bmap_size = bmap.GetWidth(), bmap.GetHeight()

        wx.Frame.__init__(self, None, size=bmap_size)

        my_component = wx.StaticBitmap(self, bmap)
        self.SetClientSize(bmap_size)
         
class MyApp(wx.App):
    def __init__(self, fname):
        self.fname = fname
        wx.App.__init__(self)

    def OnInit(self):
        img = wx.Image(self.fname, wx.BITMAP_TYPE_JPEG)
        frame = MyFrame(img)
        frame.Show()
        return True

app = MyApp("wxPython.jpg")
app.MainLoop()
----

I find it perplexing that the authors introduce a function called
ConvertToBitmap() in the first chapter, yet when I look in the index,
there is no information on it, and when I look in the chapter dedicated to
"Manipulating basic graphical images" in the subsection titled "Creating
bitmap objects", there is no mention of the function.
The function wx.StaticBitmap() in the example is nowhere to be found in
the index either, nor is it in the chapter "Manipulating basic graphical
images", subsection "Creating bitmap objects" where you might expect to
find such a description. To me that seems like a curious way to write a
book: introduce two function in an introductory example and never explain
what they do or how to use them.

Is there wxPython documentation somewhere where I can look up a function
name and get the signature and a description of the parameters?

Thanks