How to add a label to wxWidgets wxBitmapButton?

How do I create a button using wxWidgets that has both a label (text) and an image or icon. If I select wxBitmapButton, a field called "label" appears. But whenever I write anything in this field, it doesn't update the code in wxFormBuilder. I also tried wxButton-> SetLabel () but no luck.

Any help or suggestions would be appreciated.

+3


source to share


1 answer


You can only do this in wxWidgets 2.9.1 or higher and can use either wxBitmapButton or wxButton. To quote the documentation :



Since version 2.9.1 wxButton supports displaying text and images (currently only when using the wxMSW, wxGTK, or wxOSX / Cocoa ports), see SetBitmap () and SetBitmapLabel (), SetBitmapDisabled (). In previous versions of wxWidgets, this feature was only available in the (now trivial) wxBitmapButton class, which was only capable of displaying an image without text.

+5


source







All Articles