[Pythonmac-SIG] arghh, wxBitmapButton problem ...

Darran Edmundson darran.edmundson at anu.edu.au
Fri Jan 28 23:21:48 CET 2005


I'm having problems with wxBitmapButton as discussed
in this post to the wxPython-users list yesterday.  Robin
indicates that this is a known problem on the Mac.  I wonder
if someone here can confirm this and possibly point out
a workaround?  What confuses me is that the wxBitmapButton
example in the wxPython Demo works fine (PNG image
encoded with img2py).

Any help is much appreciated.

Cheers,
Darran.

-------- Original Message --------
Subject: Re: [wxPython-users] arghh, colour wxBitmapButton problem ...
Date: Fri, 28 Jan 2005 11:31:03 -0800
From: Robin Dunn <robin at alldunn.com>
Reply-To: wxPython-users at lists.wxwidgets.org
To: wxPython-users at lists.wxwidgets.org
References: <41FA4740.2030000 at anu.edu.au>

Darran Edmundson wrote:
> 
> I've been trying desperately for the last few hours to get
> a colour wxBitmapButton working.  It seems so simple:

> but my buttons thus created don't appear properly.  I've put a
> screen capture of a test app on:
> 
>     http://anusf.anu.edu.au/~dee900/Projects/wxPython/
> 
> along with two of the source images.  I've tried converting
> the source images in Photoshop to 8-bit PNG, index-colour,
> etc., all to no avail.
> 
> Looking at the wxPython wxBitmapButton demo, the
> authors use hardcoded XPM images rather than loading from

Actually they are PNG images that have been encoded into a Python source
file using the img2py tool included with wxPython.

> a file via one of the wx image loaders.  Surely one can load from
> a file though, no?

Yes.  The problem you are running into is a known problem with
BitmapButtons on wxMac.  I don't know the details but it is something to
do with which native format that is being used to give the image to the
native control.  If you put the same image in wx.StaticBitmap then
you'll see that it is being loaded okay.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org

-- 
Darran Edmundson (darran.edmundson at anu.edu.au)
ANU Supercomputer Facility Vizlab
Australian National University, Canberra, ACT 2600
tel: +61 2 6125-0517  fax: +61 2 6125-5088


More information about the Pythonmac-SIG mailing list