Passing a string to a callback function



Hi.

I am having problems trying to pass a string to a callback
function via g_signal_connect. Isn't that possible?

For example, in main I have something like

g_signal_connect(widget, "whateversignal", G_CALLBACK(callbackfunc),
                        (gchar *)"string I want to pass");

My callaback function could be

void callbackfunc(gchar *string)
{
	printf("%s\n", string);
}

But it doesnt print the string I pass to it, it prints something strange
instead. What am I doing wrong?


Thanks.



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