[Glade-users] signals


When you have to pass more than one argument, pass a structure pointer and 
cast is to gpointer.
here's an example:

Same goes to pass an array. Then cast it in the callback function.

static void callback(GtkWidget *widget, gpointer data)
  g_print ("%s was passed\n", (char *) data);


 button = gtk_button_new ();
 g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (callback), 
(gpointer) "This is a char array");

On Sunday 11 February 2007 23:11, Mariano Perez-Sauquillo Perera wrote:
i would like to make a handler for a g_signal_connect like:

  g_signal_connect ((gpointer) checkbutton2, "activate",
                    G_CALLBACK (on_checkbutton2_activate),

but i would like to send some more values to the callback function instead
of the null, like a array of integers but i am not able to get it, could
someone help me please?

thanks in advance

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