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 ! Thanks ! __

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-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:

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: > >>

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_wid

g_object_set_data

2006-11-23 Thread Guillaume Charhon
Hi, I've some problem with the function g_object_set_data and g_object_get_data When I do guint i,j; int test; i = 4; j = 6; g_object_set_data(G_OBJECT(game->pButton[i][j]), "position_x", GUINT_TO_POINTER(i)); test = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(game->pButton[i][j]), "position_x"

Re: g_object_set_data

2006-11-23 Thread Guillaume Charhon
But it's the same button :'( ! David Nečas (Yeti) a écrit : > On Thu, Nov 23, 2006 at 08:18:42PM +0100, Guillaume Charhon wrote: > >> When I do >> >> guint i,j; >> int test; >> i = 4; >> j = 6; >> >> g_object_set_data(G_O

Re: g_object_set_data

2006-11-23 Thread Guillaume Charhon
gt; On Thu, Nov 23, 2006 at 08:37:06PM +0100, Guillaume Charhon wrote: > >> But it's the same button :'( ! >> > > Did you really check it's the same object (e.g., printed > address, although this is not 100% if the object is > destroyed meanwhile) a

Re: g_object_set_data

2006-11-24 Thread Guillaume Charhon
But it's the same button :'( ! David Nec(as (Yeti) a écrit : > On Thu, Nov 23, 2006 at 08:18:42PM +0100, Guillaume Charhon wrote: > >> When I do >> >> guint i,j; >> int test; >> i = 4; >> j = 6; >> >> g_object_set_data(G_O

Re: g_object_set_data

2006-11-24 Thread Guillaume Charhon
You were right, I've find the problem, the bouton was recreated in an other function. So the first button with the data was erased... Thanks you for your useful help! Guillaume Guillaume Charhon a écrit : > I've checked the adresses, they are not the same. > The second butt