[wxPython-users] Re: Transparent windows inwxPython

Robin Dunn robin at alldunn.com
Mon Oct 8 12:13:53 PDT 2007


Don Taylor wrote:
> Guilherme Polo wrote:
> 
>> Top level windows have a method called SetTransparent, it takes a
>> value from 0 (opaque) to 255 (invisible?)
> 
> Ok, that sounds good for the transparency part and I have found the 
> relevant example in the wiki which is great!
> 
> http://wiki.wxpython.org/Transparent_Frames?highlight=%28transparent%29
> 
> But what about window focus?  If I have a transparent window covering a 
> normal window from a _different_ application and I click on the common 
> area then:
> 
> Which window gets the focus?
> 
> Can I type into the underlying window as if the transparent window was 
> not there?

No, the transparency only affects painting, not event propagation.  In 
that respect it will behave exactly the same way as if it were fully opaque.

However you might try giving the transparent window the FLOAT_ON_PARENT 
style and then Raise() the parent window and see if it will then get the 
keyboard focus like you want.  Mouse events will still be a problem however.


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





More information about the wxpython-users mailing list