Re: g_signal



g_signal_connect is not so differant than gtk_signal*

the declaration of a funtion callback for a button is
ex:
....
my_callback (gtk_widget *widget,
                        gpointer data);

some widget need more declarations see the gtk-doc for more explanation

here a example of code

static void
on_button_clicked (GtkWidget *widget,
                                   gpointer data)
{
 printf("%s\n", (char*) data);
}

int
main(void)
{

....

g_signal_connect( G_OBJECT(button) , "clicked",
G_CALLBACK(on_button_clicked), (gpointer) "hello");
....

}

hope this help you
best regards




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