Signal data value ?



I am having problems trying to get a data value from a signal.  I have a
gchar pointer which when I connect up the signal has the value 134685549,
but when I check the data value in the callback function I get a entirely
different value, -1073751463.
And I can't access the correct data.  What am I doing wrong?

gchar *str;

str = g_malloc0(100);

printf("str=%d\n",str);
gtk_signal_connect( GTK_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(display_msg), str);

display_msg( GtkWidget *widget, gpointer data)
{
  printf("data=%d\n",data);
}

Tim M.




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