Re: Signal handlers: parameter names



Hi,

John Margaglione <jmargaglione yahoo com> writes:

> I was thinking about tools like glade, and specifically a tool I wrote a
> little while back called g2c, which converts glade XML files to C code. 
> One of the problems I had then was that I could get the types of all of
> the parameters to a signal, but I couldn't get the names of the
> parameters.  It seems this is still an issue, since gtk_signal_new still
> does not contain a place to name your signal's arguments.  This would be
> enormously handy for tools like glade.  Right now we have to maintain
> huge lists of signal handler names/parameters in our code, then do table
> lookups on the lists to write out the C code.  If we could dynamically
> discover the types AND names of the parameters, it would reduce the
> amount of BS code we have to write a LOT.  It would also allow GUI
> builders to handle new widget callbacks without recoding the builder.  

I think gsignal from GObject has everything you ask for. Signal arguments
are GTypes which are registered (statically or dynamically) together with 
their name. Have a look at the signal and type API of GObject.


Salut, Sven




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