[10526] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] PROPOSAL: change data argument of object signals

daemon@ATHENA.MIT.EDU (Tim Janik)
Mon Nov 30 05:38:10 1998

From: Tim Janik <timj@gtk.org>
Date: Mon, 30 Nov 1998 11:06:51 +0100 (CET)
To: Gtk+ MList <gtk-list@redhat.com>,
  Gtk+ Developers <gtk-devel-list@redhat.com>
cc: Hacking Gnomes <Gnome-Hackers@athena.nuclecu.unam.mx>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

hi all,

as most of you know, a gtk_signal_connect (button, "clicked", test_func, data)
invokes test_func as

void test_func (GtkButton *button, gpointer data);

whereas gtk_signal_connect_object (button, "clicked", test_func, data) is
usually used to invoke a function as

void test_func (gpointer data);

but in fact, it is invoked as

void test_func (gpointer data, gpointer data);

i'd like to change this behaviour of object signals.
with the current implementation we loose data on the way, i.e. the
object pointer which gets overidden with the data pointer. imho, the
data pointer should be swapped with the object pointer, rather than
overwriting it, so for gtk_signal_connect_object (button, "clicked",
test_func, data), what we will get is

void test_func (gpointer data, GtkButton *button);

since object signals are usually only used for signal handlers with one
argument, this change shouldn't cause any problems. if someone depends
on the current behaviour of object signals to pass the data pointer
twice, i herewith prompt him to speak up ;)

---
ciaoTJ

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post