Hi, I begun my gtk+ programming in C and I thought it could be fun to "develop some tutorials further" so I took the interface from a tutorial and wanted to connect callback functions to the buttons. Here is my code...
Code:
/*definition of a structure that hold all the parameters I want to send to callback function*
typedef struct
{
    int cisliceee;
    GtkWidget*nalepka;
        int poziceee;
}vstup;
//declaration of an array of those structures//
vstup*v[16];
/*main callback function called by all the buttons, what will happen is to be 
determined by the content of the structure that is passed as an argument, I think
 my whole problem might be in the pointer to v object*/
void cudl_stisknut(GtkWidget *widget, vstup*v)
{   if (v->poziceee=8){
    gtk_main_quit();}
   
}
}
...
int main(int argc, char* argv[]){
...
/*things used to build up the GUI*/
GtkWidget *cudl[16];

  char *hodnoty[16] = { "1", "2", "3", "/",
     "4", "5", "6", "*",
     "7", "8", "9", "-",
     "0", ".", "=", "+"
  };
/*implementation of v array*/
int iks;
    for( iks=0; iks<16; iks++) {
        v[iks]= g_slice_new (vstup);
    }
/*function to construct a GUI table as well as store necessary arguments in v structure*/
int i = 0;
  int j = 0;
   int pozice = 0;
     for( i=0; i < 4; i++) {
    for( j=0; j < 4; j++) {
     cudl[pozice] = gtk_button_new_with_label(hodnoty[pozice]);
       
cislice[pozice]= atoi(hodnoty[pozice]);
        v[pozice]->cisliceee=cislice[pozice];
        v[pozice]->nalepka=vysledkovy_radek;
        v[pozice]->poziceee=pozice;
{      gtk_table_attach_defaults(GTK_TABLE(ciselnice), cudl[pozice], j, j+1, i, i+1 );
      pozice++;
    }
  }
}
/*and finally connecting the signal (the same one) to all the buttons*/
for (pozice=0; pozice < 16; pozice++){
    g_signal_connect(G_OBJECT(cudl[pozice]), "clicked",
     G_CALLBACK(cudl_stisknut), (gpointer) v[pozice]);
}
NOW the big problem is that not only clicking cudl[8] which passes with its signal structure v[8] that holds v[8]->poziceee=8 causes TRUE in the condition of the callback function and therefore gtk_main_quit BUT ALSO ALL THE OTHER BUTTONS!!!. I spent a lot of time trying to make it work, but no matter the condition in cudl_stisknut() is always taken as true no matter which button I press...
I hope that somebody can help... thank you a lot