[wx-dev] R: [wx-dev] R: [wx-dev] How to make Transparent sizers?

Kit Bishop misc at bishop.net.nz
Thu Aug 30 04:05:33 PDT 2007


Baldassarre Cesarano wrote:
> My platform is wxMSW-2.8.5-rc3 - XP
> Your work around does not work for me because I has a bitmap as
> background!
> My impression is that wxStaticBox it has an own surface, and is not
> simply a frame!
>  =

> Ciao
> Baldo
No, it wouldn't work for your case - presumably you handle the erase
background event (or paint event) for the parent panel to draw the
bitmap in the background.  I wonder if in your case, you could handle
the erase background event for the static box to do nothing and hence
make it transparent - don't know if it will work but it might be worth a
try.

wxStaticBoxSizer is an odd thing - it's used like a sizer but has a
static box.  The main issue from my perspective is that the behaviour is
different between MSW and Linux with respect to inheriting the
background colour.

Best regards,
Kit

>  =

>
>     ---------------------------------------------------------------------=
---
>     *Da:* Kit Bishop [mailto:misc at bishop.net.nz]
>     *Inviato:* mercoled=EC 29 agosto 2007 22.04
>     *A:* wx-dev at lists.wxwidgets.org
>     *Oggetto:* Re: [wx-dev] R: [wx-dev] How to make Transparent sizers?
>
>     Baldassarre Cesarano wrote:
>>     Self-answer!
>>     With wxBoxSizer the background image is visible, then ok.
>>     The problem is with wxStaticBoxSizer (then wxStaticBox)...
>>
>>         ----------------------------------------------------------------=
--------
>>         *Da:* Baldassarre Cesarano
>>         [mailto:baldassarre.cesarano at eunics.it]
>>         *Inviato:* mercoled=EC 29 agosto 2007 13.02
>>         *A:* wx-dev at lists.wxwidgets.org
>>         *Oggetto:* [wx-dev] How to make Transparent sizers?
>>
>>         Hi to all,
>>         I have a wxFrame with a tiled background bitmap.
>>         With controls and sizers creation this image disappear!
>>         The image is re-painted in the EVT_ERASE_BACKGROUND event =

>>          =

>>         How to make a transparent sizer showing background image of
>>         the parent window?
>>          =

>>         Tnx!
>>             Baldo
>>          =

>>
>     This sounds very much like an issue I asked about on wx-users
>     recently.  What platform are you on?  I am having the same problem
>     with wx 2.8.4 under openSuSE Linux 10.2.  The same code works fine
>     under MSW.  It appears as if the wxStaticBox is getting the
>     default background rather than inheriting it from the parent.  I
>     am currently using a work around that sets the wxStaticBox
>     background colour to the same colour as the parent background.
>
>     Best regard,
>     Kit Bishop
>      =

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20070830/0d5f5=
e91/attachment.htm


More information about the wx-dev mailing list