Re: g_object_set_data



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_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"));
It works !

But you should decide whether the value is signed or
unsgined anyway to avoid surprises.

But when I use in an other function who was called from a button event
x = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(pButton), "position_x"));

There is a "0" in x!!!!!!!!

Check your code.  game->pbutton[i][j] and pbutton are two
different objects.

Yeti


--
Whatever.



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