views:

15

answers:

2

So far I've not been able to find any way to make the background of a GtkProgressBar transparent. I've tried setting a transparent image as the background, but the alpha channel is ignored. Can this be done?

A: 

Gtk doesn't have mechanisms to handle transparency.

It would create significant performance penalty. Even changes in covered parts of the widgets would have to generate expose events. I guess there should be a method to composite widgets in your own way. But I think it'd be a lot of work to implement in C/Gtk. In C++/gtkmm it wouldn't be that hard to implement custom widget which does all the rendering itself.

buratinas
A: 

You can try it using gtkrc file. Try to do something like this.

`style "tc-theme-ProgressBar" { xthickness = 1 ythickness = 1

engine "pixmap"
{
    image
    {
        function = BOX
        orientation = HORIZONTAL
        file = "./buttons/TransparentImage.png"
        border = { 0, 0, 0, 0} # = {Left, Right, Top, Bottom} 
        stretch = TRUE #This stretches the image
    }
 }

}

class "GtkProgressBar" style "tc-theme-ProgressBar"

'

kbalar