Re: Copying X pixmap.




Shannon Rause wrote:
First, sorry if this gets posted twice *

Can someone point me in the proper direction on how to do this...

I have an X pixmap (Pixmap) and I would like to copy its contents onto a
GdkWindow.  I have tried to use XCopyArea() to do this but it appears that
the background is redrawn over the copied pixmap.  I set it up so the
XCopyArea() occurs in the windows expose event. You can actually see the
pixmap contents as it blinks when you resize the window but it is
immediately replaced by the standard gray background color.  Can someone
tell me what I may be doing wrong?

Thanks.

Are you trying to make the pixmap the background of the window, or just a pixmap widget that can be displayed anywhere in the window? I'm assuming it has to be an X Pixmap and you can't use gtk_pixmap_new_from_file or some related call? You can wrap the X pixmap in a gdk pixmap by using gdk_pixmap_foreign_new(). You can set the window background to it with gdk_window_set_back_pixmap(). You may also need to call gtk_widget_set_app_paintable() to stop the default background from being drawn over top of the pixmap.

Good luck!
--Brett




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