Howto draw a cairo surface onto a gdkwindow



Hi,

i have problems created a shaped (partly transparent) cairo overlay over a gdkwindow
(a gtkdrawablearea already being used to display a pixmap).

The problem: 
i am adding some "OSD" controls to a gtk map renderer. My first attempt was to directly
draw my controls into the pixmap used for the map and remove/redraw them whenever the
map is being used. This works fine in most cases. But the map can be moved via mouse
drags and hence the pixmap may be moved such that it's not covering the area where the
controls are supposed to be placed anymore (the controls would just have to be placed 
outside the pixmap).

There are imho three solutions for my problem:
- extend the pixmap by one window width and height into each direction so the user just cannot
  drag the map off the window. The downside:  i need a pixmap nine times bigger than the 
  window which is imho a waste of memory
- just hide my controls while the user drags the map. i just don't like this, but this will
  be my backup solution
- draw someting on top of the pixmap after it's being drawn. Therefore i need something
  transparent i can draw. But i don't find a way to draw a cairo surface directly onto the
  gdkwindow (after the map itself has been drawn).

Any help is appreciated!

Till



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