Re: Text Label on top of button Image



Bill Sousan wrote:
[...]
I tried using both the button's label and image.  However, it always
appeared to want to push the image to one side of the button, and push the
label to the other side of the button. I was not able to find a way to
overlay the label on top of the button image.

    Using gtk_button_set_image is like setting the image to be
the "item" of the button, a button can not have more than one item.

You want to set the graphical state of the button, for this you'll
need to use the theme engine, see:
    http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html

(you can probably find examples, maybe tutorials if you grep the
internet a little further).

Cheers,
                              -Tristan

PS: Generally, your button theme entry will look something like this:
=====================================================================

style "albs_jacket" = "eventbox"
{
        engine "pixmap"
        {
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = NORMAL
                        detail                  = "buttondefault"
                        shadow                  = IN
                        file                    = "asi/albs_jacket_up.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = NORMAL
                        shadow                  = OUT
                        file                    = "asi/albs_jacket_up.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = PRELIGHT
                        shadow                  = OUT
file = "asi/albs_jacket_up.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = NORMAL
                        shadow                  = IN
file = "asi/albs_jacket_up.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = INSENSITIVE
                        shadow                  = IN
                        file                    = "asi/albs_jacket_up.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch                 = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = INSENSITIVE
                        shadow          = OUT
file = "asi/albs_jacket_up.png"
                        border          = { 0, 0, 0, 0 }
                        stretch         = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = SELECTED
                        shadow                  = IN
file = "asi/albs_jacket_up.png"
                        border          = { 0, 0, 0, 0 }
                        stretch         = TRUE
                }
                image
                {
                        function                = BOX
                        recolorable             = TRUE
                        state                   = ACTIVE
                        shadow                  = IN
file = "asi/albs_jacket_dn.png"
                        border                  = { 0, 0, 0, 0 }
                        stretch         = TRUE
                }
        }
}



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