Re: Why doesn't GTK+...
- From: Owen Taylor <otaylor redhat com>
- To: "Vomjom" <vomjom earthlink net>
- Cc: <gtk-list redhat com>
- Subject: Re: Why doesn't GTK+...
- Date: 16 Jul 1999 09:52:12 -0400
"Vomjom" <vomjom@earthlink.net> writes:
> GTK+ allows one argument for functions like
> gtk_signal_connect()... why doesn't it allow multiple arguments
> using ellipses (...) as an argument? This could fit in many places,
> such as gtk_slist_append(), allowing you to append more than one
> thing at a time.
This is impossible to do in a portable manner - while
having a gtk_signal_connect() variant that took an
arbitrary number of user data arguments is easy
to do using varargs, the problem is writing code
that can call:
void callback (GtkWidget *widget, gpointer data)
and
void callback (GtkWidget *widget, gpointer data1,
gpointer data2)
and
void callback (GtkWidget *widget, gpointer data, gpointer data2,
gpointer data3)
and so forth.
To do that portably, you'd have to have one variant
of your calling function for each number of arguments.
There is a library called libffi out there that could
probably be used to do this - it has knowledge of
how the call stack works for various platforms.
But that would certainly make GTK+ harder to get
going and less portable than it is currently.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]