Re: Text Label on top of button Image

2005-10-11 Thread Tristan Van Berkom

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
}
}
}
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Text Label on top of button Image

2005-10-10 Thread Bill Sousan
Is there a way to have a text label on top of a button image?  What I am
looking to do is to customize the button widget with images for the pressed
and released button states.  However, I still want to have a label on top of
the image so that I can change the text and font size without having to
change the image. In other words, I am trying to avoid having to have the
text embedded in the image.  

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.

 

Thanks,

Bill Sousan

 

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list