Passing a string to a callback function

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

 



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.
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux