Re: [gtkmm] transparent background in drawing area



Am Mon, 2003-07-07 um 17.34 schrieb Sven Eric Panitz:
> Hi all,
> I started to play around  a bit with gtkmm just recently. I wonder how to 
> create a (undecorated)

this is done with the call

your_window->set_decorated(false);

>  window containing a drawing
> area, such that background of the window (and drawingarea) are
> transparent. I had a look at the wheelbarrow example, which seems rather 
> complicated, since it needs to define a mask for a picmap.
> 

that is the only way to make gtk / gdk windows real transparent (the
other way is to act like the panel or gnome-terminal which grab the root
window and render them as background to it's own windows).

but its realy simple to create the pixmap and mask.

for simple images you can use the gdk-pixbuf  render_pixmap_and_mask
function, that creates your pixmap and bitmap at once.

also you can use all the drawing functions like lines and circles in the
same way on pixmaps and bitmaps.

keep in mind, a bitmap is simply a pixmap with a depth of 1.

cheers detlef


> Any ideas? (For an exercise I was trying to write a clock with
> transparent background for my desktop).
> 
> thanks in advance sven eric




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]