Thanks, but how can I "ref it or sink it" ? Guillaume
Ed Catmur a écrit : > Guillaume Charhon writes: >> I've some problems to change an image on a button. >> See the example : >> >> gtk_button_set_image(GTK_BUTTON(theButton), ImageOne); // ok >> gtk_button_set_image(GTK_BUTTON(theButton), ImageTwo); // ok >> gtk_button_set_image(GTK_BUTTON(theButton), ImageOne); // ImageOne >> doesn't appear ! >> > GtkImage, like other GtkWidgets, is created floating. The first call > to gtk_button_set_image() sinks the floating ref, then the second call > unrefs it and the GtkImage ImageOne is destroyed. This method is used > because it simplifies refcount handling for the usual case. If you > want to reuse ImageOne you need to ref or sink it yourself. > > Ed Catmur > _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list