wx.BitmapButton on Mac

Hi All,

I have created a PNG to look like a standard mac button. When I create the button without style=NO_BORDER, everything looks correct. However, when I use style=NO_BORDER, while the border disappears, there is an invisible ‘border’ or padding around the button that appears to be square, and the size of the button’s largest dimension (in this case, it’s width). wx.BitmapButton.GetSize() returns the correct size. If I specify the size when I create the button, the image shrinks down drastically both horizontally and vertically. How can I fix this?

Thanks,

Patrick

Hi,

···

On Sat, Feb 27, 2010 at 10:42 AM, Patrick Tisdale <patrick.tisdale@gmail.com> wrote:

Hi All,
I have created a PNG to look like a standard mac button. When I create the
button without style=NO_BORDER, everything looks correct. However, when I
use style=NO_BORDER, while the border disappears, there is an invisible
'border' or padding around the button that appears to be square, and the
size of the button's largest dimension (in this case, it's width).
wx.BitmapButton.GetSize() returns the correct size. If I specify the size
when I create the button, the image shrinks down drastically both
horizontally and vertically. How can I fix this?

There are some limitations with the borderless version of the control
on wxMac. IIRC the native control only supports some specific
dimensions (16x16, 24x24, 48x48, 128x128).

Might want to try the generic bitmapbutton control in wx.lib.

Cody

OK, so that works. The next issue is that the background color that surrounds the button changes to white when the button is in the ‘clicked’ state. Once the button is released, it changes back to the background color set by SetBackgroundColour().

Patrick

···

On Sat, Feb 27, 2010 at 11:47 AM, Cody Precord codyprecord@gmail.com wrote:

Hi,

There are some limitations with the borderless version of the control

on wxMac. IIRC the native control only supports some specific

dimensions (16x16, 24x24, 48x48, 128x128).

Might want to try the generic bitmapbutton control in wx.lib.

Cody

Hi,

···

On Feb 27, 2010, at 11:52 AM, Patrick Tisdale wrote:

OK, so that works. The next issue is that the background color that surrounds the button changes to white when the button is in the 'clicked' state. Once the button is released, it changes back to the background color set by SetBackgroundColour().

Probably a bug in the generic control. It is implemented in python so you can just look at the source and see if anything needs to get changed.

Cody

p.s) please don't top post