Re: Change an image on a button

2006-11-16 Thread Guillaume Charhon
Oh yes ! It works too ! David Nec(as (Yeti) a e'crit: > On Thu, Nov 16, 2006 at 03:45:25PM +0100, Guillaume Charhon wrote: > >> I've find a solution with >> >> gtk_container_remove() and gtk_container_add() >> >> But I must do a gtk_widget_show_all(pButton) !!! >> > > Calling gtk_widget_s

Re: Change an image on a button

2006-11-16 Thread Yeti
On Thu, Nov 16, 2006 at 03:45:25PM +0100, Guillaume Charhon wrote: > I've find a solution with > > gtk_container_remove() and gtk_container_add() > > But I must do a gtk_widget_show_all(pButton) !!! Calling gtk_widget_show() on the images (as my second demo program does) does not work for you?

Re: Change an image on a button

2006-11-16 Thread Guillaume Charhon
Thanks for your answer, I've find a solution with gtk_container_remove() and gtk_container_add() But I must do a gtk_widget_show_all(pButton) !!! Guillaume Charhon David Nec(as (Yeti) a écrit : > On Wed, Nov 15, 2006 at 10:40:06PM +0100, Guillaume Charhon wrote: > >> But I have read everyth

Re: Change an image on a button

2006-11-16 Thread Yeti
On Wed, Nov 15, 2006 at 10:40:06PM +0100, Guillaume Charhon wrote: > But I have read everything and it doesn't work! You are right. The problem is not with reference counting any more. Something strange happens to the image widget that makes it invisible after removal from the button. This is s

Re: Change an image on a button

2006-11-16 Thread Guillaume Charhon
But I have read everything and it doesn't work ! I've tested all example from http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#floating-ref But the result is the same ! ImageTwo is destroyed. Thanks. Ed Catmur a écrit : > Tristan Van Berkom writes: >> Guillaume Ch

Re: Change an image on a button

2006-11-15 Thread Ed Catmur
Tristan Van Berkom writes: > Guillaume Charhon wrote: >> Thanks, but how can I "ref it or sink it" ? >> > Every widget in gtk+ is an object: > http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Typ > e.html#GObject Specifically, a GInitiallyUnowned; see http://developer.gno

Re: Change an image on a button

2006-11-15 Thread GuiGui
quot;Tristan Van Berkom" > A : "Guillaume Charhon" > Copie à : "Ed Catmur" , gtk-app-devel-list@gnome.org > Objet : Re: Change an image on a button > > Guillaume Charhon wrote: > > Thanks, but how can I "ref it or sink it" ? > >

Re: Change an image on a button

2006-11-15 Thread Tristan Van Berkom
Guillaume Charhon wrote: > Thanks, but how can I "ref it or sink it" ? > Every widget in gtk+ is an object: http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#GObject Cheers, -Tristan ___ gtk-app-devel-list

Re: Change an image on a button

2006-11-15 Thread Guillaume Charhon
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 &g

Re: Change an image on a button

2006-11-15 Thread Ed Catmur
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),

Change an image on a button

2006-11-15 Thread Guillaume Charhon
Hi, 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