So, let's say you have you GtkButton and your GtkLabel. You have to connect the button to the "clicked" signal to handle the click. In your main function, do this to connect it:
Code:
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_clicked), (gpointer) label);
In this signal connection, you are passing the GtkLabel as the fourth parameter of g_signal_connect(). You can then use the following callback function:
Code:
static void
button_clicked (GtkButton *button, gpointer data)
{
GtkLabel *label = GTK_LABEL (data);
/* Do whatever you want here, using the label ... */
}
If you are already passing something in the user data parameter, consider creating a structure that holds the label and your data. You can pass that structure to the callback function, since gpointer is just a void pointer (void*).