Hello,
I am trying to pass data to a GCallback when a GtkMenuItem "activate" event occurs.
The data passed to g_signal_connect is fine but when the callback is called, data is always NULL.
Does someone can help me to fix this bug ?
Thanks,
Here is sample code :
GtkTextBuffer * log_buffer = gtk_text_buffer_new(NULL);
// Here log_buffer != NULL
g_signal_connect ((gpointer) item_cut, "activate",
G_CALLBACK (on_cut_activate),
log_buffer);
...
void on_cut_activate(GtkMenuItem *menuitem, gpointer user_data)
{
GtkTextBuffer * buffer = GTK_TEXT_BUFFER(user_data);
// Here user data == NULL so the cast fail
}
I am trying to pass data to a GCallback when a GtkMenuItem "activate" event occurs.
The data passed to g_signal_connect is fine but when the callback is called, data is always NULL.
Does someone can help me to fix this bug ?
Thanks,
Here is sample code :
GtkTextBuffer * log_buffer = gtk_text_buffer_new(NULL);
// Here log_buffer != NULL
g_signal_connect ((gpointer) item_cut, "activate",
G_CALLBACK (on_cut_activate),
log_buffer);
...
void on_cut_activate(GtkMenuItem *menuitem, gpointer user_data)
{
GtkTextBuffer * buffer = GTK_TEXT_BUFFER(user_data);
// Here user data == NULL so the cast fail
}
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list