Using: gtk_button_set_image() gives small empty buttons



Hi again,

        Another little problem of mine is that no matter what I seem to do, I can't get my buttons to contain 
small png's read from disk like this:

GtkWidget *button = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(button), gtk_image_new_from_file(filename));
gtk_widget_show(button);

I can display the "gtk_image_new_from_file(filename)" widget on its own, and it does contain my image (I've 
tried both line-art and grey-scale images), but when "gtk_button_set_image()"-ing the image to my button I 
get a silly little button probably about 5x5 pixels in size with no image within!?
        I have replaced the above three lines with f.ex. "gtk_button_new_from_stock()" which works fine, so 
what's the deal here??

        br - Nikolaj Thygesen :o)





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