Search code examples
wxpython

Is it possible to have a transparent window while having opaque children?


My goal is to create a window that has a variable level of transparency and no standard border. On top of that area I would like to display opaque items, especially text, that might need to be made transparent. I have tried using SetTransparency methods, SetBackgroundColor and wx.TRANSPARENT_WINDOW styles but haven't had any luck in essentially keeping the children transparency level independent from the parent window's. I have started looking into the graphic and draw methods but not sure if this result is even possible to implement in wxPython. Should I be using a different tool or can this be achieved in wxPython?


Solution

  • wxPython does not support this behavior. You might be able to fake it by creating lots of custom widgets or by drawing everything, but it will be a lot of work. You would be better off switching to a different toolkit that has this sort of thing builtin. wxPython is for developers that want to make applications that look native on the target OS.