Passing data to a callback (again)
- From: Frank Cox <theatre melvilletheatre com>
- To: gtk-app-devel-list gnome org
- Subject: Passing data to a callback (again)
- Date: Tue, 31 Jul 2012 09:55:51 -0600
I think I'm missing something fundamental here. My understanding is that I can
pass one pointer to a callback and that's it. And that works.
When I look at the example provided for "How do I validate/limit/filter the
input to a GtkEntry?" in the Gtk+ FAQ (version 2.18.9 in my case) I see that
the callback header looks like this:
void insert_text_handler (GtkEntry *entry, const gchar *text, gint length, gint
*position, gpointer data)
The g_signal connect line looks like this:
g_signal_connect(G_OBJECT(entry), "insert_text", G_CALLBACK
(insert_text_handler), NULL);
So we're passing NULL data to the callback function, but somehow that function
is receiving const gchar *text, gint length, gint *position, gpointer data.
This obviously doesn't square with the idea that you can pass one single
pointer to a callback.
What have I missed?
--
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
www.creekfm.com - FIFTY THOUSAND WATTS of POW WOW POWER!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]