How to make panel visible on transparent frame?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make panel visible on transparent frame?

BillBridge
I am trying to make a panel containing buttons visible on a frame that has been made transparent using SetShape().
Unfortunately, the panel becomes transparent as well. When I adjust the shape a bit, some parts of the panel become visible. See attached example where on top of the red frameborders the parts of the panel are visible.

How could this be achieved for the full panel thereby maintaining transparency of the frame itself?


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

trframe.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to make panel visible on transparent frame?

Claudia Frank
Sorry, not 100% sure what you try to achieve.
Is this device contect manuipulation needed?
Maybe a self.SetTransparent(50) in the FancyFrame class is already sufficient?

Cheers
Claudia

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to make panel visible on transparent frame?

BillBridge
Hi Claudia,

Thanks for your reply.
SetTransparant does not work as it put the complete Frame in transparency. I only want to have the background transparent so that the widgets in the Frame are 100% visible and catch the mouse events and where the mouse events on the transparent parts are being caught by the application 'behind'. See example:

Thanks,
Wim

example.png



Op woensdag 7 november 2018 21:04:51 UTC+1 schreef Claudia Frank:
Sorry, not 100% sure what you try to achieve.
Is this device contect manuipulation needed?
Maybe a self.SetTransparent(50) in the FancyFrame class is already sufficient?

Cheers
Claudia

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to make panel visible on transparent frame?

Robin Dunn
On Wednesday, November 7, 2018 at 10:41:01 PM UTC-8, BillBridge wrote:
Hi Claudia,

Thanks for your reply.
SetTransparant does not work as it put the complete Frame in transparency. I only want to have the background transparent so that the widgets in the Frame are 100% visible and catch the mouse events and where the mouse events on the transparent parts are being caught by the application 'behind'.

You can do something like that by setting the shape of the frame such that the areas where the buttons are located are not masked out (not transparent) and the rest of it is masked out. You do that by creating a wx.Region defining the transparent regions, and an easy way to do that is to create the region from a bitmap with a mask. The region is then used in the call to SetShape.

I'm not sure if the mouse clicks will pass through however, that is undefined by wx and may be dependent on the platform.

--
Robin
 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.