[pygtk] Making part of a GTK-window transparent and position another window behind

Christoph David Hermann funkyhermann at gmail.com
Tue Feb 23 15:33:25 WST 2010


Hello to all,

I'm planning to develop a simulation game using panda3D 
(http://www.panda3d.org/) and pygtk. Unfortunately, it is not possible 
export an OpenGL-context from panda3D and directly draw on a GTK widget 
using an OpenGL-extension. So I decided to draw the main window with 
pygtk, make a part of the window transparent and position the panda3D 
window behind it. I want the GTK-window to capture all keyboard and 
mouse inputs.

My approach was to use shape_combine_mask 
(http://www.pygtk.org/docs/pygtk/class-gdkwindow.html#method-gdkwindow--shape-combine-mask) 
to make the right part of the window transparent. This works like a 
charme except for one thing: The GTK window isn't only transparent at 
the desired area; this area seems to be nonexistent, because if I click 
on this area the panda3D window captures my mouse input.

So, is there a way of making parts of a window transparent without 
making a "hole" in the window?

Using a compositing manager and set_opacity 
(http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--set-opacity) 
is no option, because running panda3D makes the composition manager 
crash and return to normal mode on my target platform.

A solution which works on windows (xp and 7) and linux (ubuntu Karmic 
Koala) would be nice ;-)

Thanks,
Christoph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100223/bfae296e/attachment.htm 


More information about the pygtk mailing list