g_object_set_data



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

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

Thanks for your help !





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