[Glade-users] signals



Hi,

When you have to pass more than one argument, pass a structure pointer and 
cast is to gpointer.
here's an example:
http://www.gnome.org/~newren/tutorials/developing-with-gnome/html/apcs04.html

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:
hello,
i would like to make a handler for a g_signal_connect like:

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

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]