Hi, I'm new here. I apoligize in advance for my english. It's not my native language.
I just start to learn GTK+ and I have problem with passing parameter in callback function. I was searching on this forum in previous topics for any advice, but I found no solution for my issue. On first sight everything looks fine but... it doesn't work as i expected. Here is the scrap of my code:
/* callback function */
void button_cf(GtkWidget *button, GdkEvent *event, gpointer data)
gint *s = (gint*) data;
/* in main funtion */
gint a = 4;
g_signal_connect (button, "clicked", G_CALLBACK (button_cf), (gpointer) &a);
When I click this button, g_print function prints an odd numbers (0 for example) instead of 4. What am I doing wrong?
I would be grateful for any help and for not yelling at me ;)