Search code examples
c++wxwidgets

Drawing a wxBitmapButton over a wxStaticBitmap


I create the bitmap first, and then the button and call button->Raise().

The button doesn't show up until I hover over it, and even though I'm supplying it with a transparent png as an image, the transparency is screwed up as can be seen here:
Example Image


Solution

  • As Raise() documentation says, this function only works for the top level windows. Overlapping child windows are not supported by wxWidgets and won't work correctly under all platforms.

    The closest you can do to what you want is to use a custom background on your parent window, which will, indeed, show behind your bitmap button.