SV: Using: gtk_button_set_image() gives small empty buttons



Well, the solution was to use "gtk_container_add(button, image)" instead of "gtk_button_set_image()", but 
this wasn't documented anywhere. I just thought that the latter function should work for any image type.

        br - N :o)

-----Oprindelig meddelelse-----
Fra: Christian Neumair [mailto:chris gnome-de org] 
Sendt: 22. februar 2006 16:37
Til: Nikolaj Kiær Thygesen
Cc: gtk-app-devel-list gnome org
Emne: Re: Using: gtk_button_set_image() gives small empty buttons

Am Mittwoch, den 22.02.2006, 12:45 +0100 schrieb Nikolaj Kiær Thygesen:
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!?

gtk_widget_show_all (button); /* might help. */

-- 
Christian Neumair <chris gnome-de org>




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