Hello! Can I use one image to many buttons? Is there any way to do that? I know that this code won't work :
Code:
GtkWidget *button, *button2;
GtkWidget *image;
image = gtk_image_new_from_file("picture.png");
button = gtk_button_new_with_label ("");
button2 = gtk_button_new_with_label ("");
gtk_button_set_image(GTK_BUTTON(button), image);
gtk_button_set_image(GTK_BUTTON(button2), image);
I know why this isn't working, but I am wondering if I can use one widget instead of table of widgets to add one picture to many buttons?
And question number two:) Why this code won't work? :
Code:
GtkWidget *button;
GtkWidget *image;
button = gtk_button_new_with_label ("");
image = gtk_image_new_from_file("picture.png");
gtk_button_set_image(GTK_BUTTON(button), image);
gtk_button_set_image(GTK_BUTTON(button), image);
I would be very grateful for any response:)
Oh, I forgot. I am using win 7 (64 bits), code:blocks 10.05, and gtk+ 2.24