Compositing widgets in GTK2?



Suppose I want to build a UI by layering several widgets with translucent png images in them. Is this possible?

For example, my main window has a background pixmap, and then I want to place a button over that which has a translucent background pixmap as well, which I would like to see composited with the window's background pixmap. The pixmap engine seems to be able to do this, but is it required?

Another example: same window with background, but now I want a label inside an eventbox which has a translucent background pixmap. I want the label anti-aliased on top of the composited pixmaps from the eventbox and the window. Possible?

I tried using the pixmap engine, and buttons do indeed seem to be able to be translucent. However, eventboxes don't seem to be able to (I always get the png composited with the default gray background). The only difference between the two as far as I can tell is that buttons use the BOX function whereas eventboxes use the FLAT_BOX function. However, I can't see in the pixbuf engine source code why the two should behave differently.

Do I have to use the pixmap/pixbuf engine to achieve this kind of functionality, or is there some other way to have "layered" widgets composite on top of each other?

Any suggestions or thoughts would be greatly appreciated.
--Brett Granger




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