scrollable widget with static background picture



Hi there,
already for a while Im trying to give my widget a background picture.
My Widget is scrollable, but when scrolling, I want that the background picture seems to be on the same place.
So Gdk::Window::set_back_pixmap doenst help (also not because of the tiling)
What I tried (in the expose handler) was a kind of my own double-buffering like :

drawable is my offscreen pixmap
background my background picture as an pixmap

Glib::RefPtr<Gdk::GC> gc__ = Gdk::GC::create(drawable);
drawable->draw_drawable(gc__, background, 0, 0, 0, 0);
//.
//more drawing operations ....
//.    

// now copy the offscreen pixmap to the window
Glib::RefPtr<Gdk::GC> gc_ = Gdk::GC::create(get_window());
get_window()->clear();
get_window()->draw_drawable(gc_, drawable, 0, 0, 0, new_position);


It does what I want, but it flickers like hell.
I turned the Gtk-doublebuffering off, because when I turn it one, it paints only "nonsense" (parts of the background picture covered multi times with other parts of the background picture)


I also had the idea, since my parent is a ScrollableWindow, to draw the background picture on this one (or on its viewport), so that I dont have to draw the background all the time, but then my Widgets background has to be somehow transparent ..... didnt find a solution for this.


Has anyone an idea ?
would be so happy .....

thanks in advance

gizmo
-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail?ac=OM.GX.GX003K11713T4783a



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