Re: gtk_widget_modify_bg and transparency



Lars Clausen wrote:
So I've read Havoc's mini-FAQ on setting colors for widgets, but I've
had little success with using it on an image-based togglebutton.  I'm
not trying to set a particular color for the background, I just want it
to be transparent, since the image takes care of showing the state. gtk_widget_modify_bg() and gtk_style both take colors, no way to set
transparency.  Will I have to make my own button and handle drawing on
my own to do this?

I put transperent widget states like this:

=================== Style in gtkrc file =======================
style "a_style"
{
        engine "pixmap"
        {
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = NORMAL        
                        shadow                  = OUT
                        file                    = "null.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = PRELIGHT
                        shadow                  = OUT
                        file                    = "null.png"  
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = ACTIVE
                        shadow                  = IN
                        file                    = "null.png"  
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
        }
}
========================================================

    So I actualy use a transperent lightweight image that gets
upscaled to whatever size the widget is.

I think this should work for you ;-)


Cheers,
                                              -Tristan




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