[wxPython-users] Re: wPython in Action: example chapter 1

Robin Dunn robin at alldunn.com
Fri Apr 20 13:03:29 PDT 2007


7stud wrote:
>> On 4/20/07, roee shlomo <roee88 <at> gmail.com> wrote:
>>
>> Change 
>> my_component = wx.StaticBitmap(self, bmap)
>> To
>> my_component = wx.StaticBitmap(self, -1, bmap)
> 
> Thanks!  Finally!

Or write it like it is in the sample in the book:

	my_component = wx.StaticBitmap(parent=self, bitmap=bmap)

;-)


> 
> 
> 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.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list