Re: invalid unclassed pointer?



Mark Leisher <mleisher@crl.nmsu.edu> writes: 
> Like one pair of functions (basically) to set/get values on an object, this is
> another area where Xt was designed correctly IMHO.  In Xt, all callbacks have
> the same 4 parameters.  In GTK terms the prototype would be:
> 
>   void (*callback)(GtkWidget *widget, GdkEvent *event,
>                    gpointer call_data, gpointer client_data);
>

This is totally broken though, because GdkEvent*event would just be
NULL most of the time, and there are many places in GTK where other
parameters are basically required.
 
> While coding, I find it convenient to have exactly the parameters I need for
> callbacks, but I have a hard time remembering the parameters required for the
> different callbacks.  Even in my own widgets.

There aren't that many variants for commonly-used signals, and you can
always look it up.

The advantages of the GTK way are numerous; one of the more important
is that signals are also introspectable virtual functions.

Havoc





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