sample code for transparent button

Hi folks,

can anyone provide some simple sample code showing how to make a button to be transparent?

I've tried this but it isn't transparent:

         wxBitmap bmp(0, 0);
         hiddenButton = new wxBitmapButton(this, SYMBSEL_HIDDENBUTTON, bmp);
         // this is light grey and stands for "transparent"
         hiddenButton->SetBackgroundColour(wxColour(0xc0, 0xc0, 0xc0));

Thanks,

Cristina.

C. Iacob wrote:

Hi folks,

can anyone provide some simple sample code showing how to make a button to be transparent?

I've tried this but it isn't transparent:

        wxBitmap bmp(0, 0);
        hiddenButton = new wxBitmapButton(this, SYMBSEL_HIDDENBUTTON, bmp);
        // this is light grey and stands for "transparent"
        hiddenButton->SetBackgroundColour(wxColour(0xc0, 0xc0, 0xc0));

Try using a bitmap that has a mask that maskes out the whole bitmap, and use style=0 when creating the wxBitmapButton so it doesn't draw the 3D border and such.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!