I am trying to make a custom flat button that has a bitmap to the left and some label text to the right all of which need to be clickable and give some sort of feedback.
I have an implementation that I think should work but is giving me some trouble that can be seen in the attached test file. Basically I thought that by creating a bitmap on the fly that combined the desired icon and drawing a label next to it in a new bitmap then putting it into a bitmap button using the wx.NO_BORDER style would do it but when using the NO_BORDER style the button turns into a white and black square.
The test file contains 5 test cases.
1) what the desired button should look like, (using a staticbitmap and static text to show appearance)
2) What I have now that is giving the problem, (my custom bitmapbutton with icon and text drawn into button)
3) The same code as number 2 but not using the NO_BORDER style shows that the bitmap is made correctly
4) Using GetBitmapLabel to get the bitmap used in the button from #2 shows that the bitmap in there is correct as well
5) Only putting the desired bitmap without label in a bitmap button and using NO_BORDER creates a flat button that gives the desired feedback and shows that the NO_BORDER style works in this case when there is no drawn text in the icon. But since the text is not part of the button it is not clickable. This is what I have settled with for now, but would really like to get #2 working.
This is on Mac OS X using wxpython 2.8.4.2 / python 2.5
Any help on this is much appreciated,
Cody
flatbmpbtn.py (5.44 KB)