newbie: on the form of callbacks...



Below are two snippets taken from the "Upgraded hello world"
example in the tutorials. My question is:  the function 
"callback" is called with _one_ argument; a pointer to "button 1", 
whereas the callback function itself has _two_ arguments...
What's going on?  


gtk_signal_connect (GTK_OBJECT (button), "clicked",
                    GTK_SIGNAL_FUNC (callback),
                    (gpointer) "button 1");


void callback( GtkWidget *widget,
               gpointer   data )
{
g_print ("Hello again - %s was pressed\n", (char *) data);
}


Thanks for any help, 

Cevat Ustun





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