[macOS] Difference between wxAnyButton::SetBitmapLabel and wxAnyButton::SetBitmap?!

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
HartwigW
In need of some credit
In need of some credit
Posts: 4
Joined: Sat May 02, 2020 3:12 pm

[macOS] Difference between wxAnyButton::SetBitmapLabel and wxAnyButton::SetBitmap?!

Post by HartwigW »

I do not understand the difference between SetBitmapLabel and SetBitmap. The documentation in wx/anybutton.h says one is a synonym of the other. The Doxygen documentation is different for both methods (interestingly, GetBitmap and GetBitmapLabel are mentioned in the Doxygen documentation as identical methods).
Looking at the code for macOS the main and significant(!) difference is SetBitmap calls SetBitmapLabel and sets the bitmap position by calling SetBitmapPosition.

The difference is significant when using a wxBitmapButton. Passing a bitmap bundle to wxBitmapButton's constructor centers(!) the bitmap in the button. Calling SetBitmapLabel to modify the bitmap still keeps the bitmap centered. When calling SetBitmap the bitmap is aligned to one of the sides.

In my case I definitely do not like the bitmap to be aligned to one of the button's edges. Therefore, the difference in the implementation is appreciated as there does not seem to be an equally easy method to center the bitmap. My question is: is this intended behaviour or is this a nice feature? Anyway, I think that documentation should be updated.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: [macOS] Difference between wxAnyButton::SetBitmapLabel and wxAnyButton::SetBitmap?!

Post by ONEEYEMAN »

Hi,
Please open an issue at github.com/wxwidgets/wxwidgets.git.
This is the user forum and no core devs are coming here.

Thank you.
Post Reply