Re: How to implement transparency in GtkWidget?



I accidentally CC'ed it to `gtk-devel-list' instead of here.
Moderators of that list can just delete the message.  Sorry.

Gaurav Jain wrote:
Hi All,

I had sent this mail to the list a few days ago, but got no reply.
Could somebody please reply to it, or let me know where I can find the
answer to my question?)

I wish to know if it is possible to draw a GtkWidget directly to an
offscreen bitmap (without drawing it on the screen).  I need this so
that I can implement transparency in the widget (over it's background
on screen), by first creating a pixmap of the widget, and then
rendering that pixmap on the screen with a set level of transparency.
(By the way, is there any direct way to implement transparency?).

Basically, this gonna be difficult and slow, if at all possible.  The
main problem is that X Window System doesn't really support transparency.

You could try to use

        gdk_window_set_back_pixmap (widget->window, NULL, FALSE);

to turn background off and then use GdkPibuf as off-screen widget
representation and on expose draw this pixbuf onto the widget.

Paul




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