PROPOSAL: change data argument of object signals



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



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