Re: size of an image on a button



sorry, looks like I am going to have to ask for a few more clues :(
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html
(and following pages) don't even hint at how to do this, as far as I can tell.

gtk_button_set_image(GTK_BUTTON(button),gtk_image_new_from_pixbuf(gdk_pixbuf_new_from_file_at_size(fname,width,height,NULL)));

at least scales the image, but only to a preset size and obviously not with the size of the button

Tristan Van Berkom wrote:
Christopher Backhouse wrote:

If I set a button to have an image like this:
Hi,
  You can accomplish what you want using a gtkrc file
and the pixbuf engine, this way you can set a graphics file
for any particular widget by name and it will scale automatically.

Cheers,
                          -Tristan





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