beginner needs help with "casting" with gtk



Hello,
I have the following callback function:

static void hello(GtkWidget *widget, gpointer data) {
    gchar * _data = (gchar *) data;
    g_print(_data);
    g_print("\n");
}


wich I call as follows:

g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(hello), "hello toto");


I get the following warning each time I compile:

warning: the format is not a litteral string and no format argument

Can anyone please help?
I need to "cast" the data variable to gchar *. What am I doing wrong?

Thanks in advance,

Julien.


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