Oh, yeah. Not to mention: there is errata for the example.
I wonder: if the authors can’t provide a simple, error free
introductory example, what chance to the rest of us have
of writing error free wxPython?
I’m also fed up with running wxPython programs that briefly
flash the window at me and quit with no error messages.
Is there some way to run wxPython programs where the errors
in the code are identified?
Googling wx.StaticBitmap will give you the needed page in wxPython's API.
I had trouble finding it, but I eventually got there. It's hard to find stuff.
You can see the Constructor if you will scroll down a little:
__init__(self, parent, id= -1, bitmap=wxNullBitmap, pos=DefaultPosition, size
= DefaultSize, style=0, name=StaticBitmapNameStr)
The second parameter is id, which is an integer. -1 means new id.
Yep. Thanks.
Except for keep following the book, I recommend looking at the API
whenever something doesn't work well. Also download the wxPython
docs and demos.
I downloaded the docs. Now we're talking! The wxDocsViewer made
it simple to find CovertToBitmap(). It's deprecated! The author's
introductory example sure has a nice selection of faults.
···
On 4/20/07, roee shlomo <roee88 <at> gmail.com> wrote:
I downloaded the docs. Now we're talking! The wxDocsViewer made
it simple to find CovertToBitmap(). It's deprecated!
The C++ version is deprecated, but the Python one isn't. If it was then you'd get a warning if you use it. When the C++ version was deprecated I wrote my own version for Python because I don't have the same limitations that the C++ code has that prompted them to deprecate it, and I felt it was too useful of a function to throw away.
BTW, ConvertToBitmap is essentially the same as wx.BitmapFromImage, which is discussed in Chapter 12.
The author's introductory example sure has a nice selection of faults.
Keep in mind that this chapter was written when wxPython 2.4 was the current version, and at least a year before work on the rest of the book began in earnest. With that much lead time it's easy to forget assumptions about what will be covered later in the book. We decided to not cover the wx.StaticBitmap widget because it is dead simple once you know the basics about wx.Window and if you have the API docs available. The introductory chapter that we wrote talking about installation (and telling you to be sure to get the API docs and the demo) got cut due to space constraints from the publisher and feedback from the reviewers.
···
On 4/20/07, roee shlomo <roee88 <at> gmail.com> wrote:
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!