Re: g_signal_*



Tim Janik <timj gtk org> writes:

> On 14 Jun 2001, Owen Taylor wrote:
> 
> > 
> > Johannes Stezenbach <js convergence de> writes:
> > 
> > > Owen Taylor wrote:
> > > > 
> > > >  3b) Modify the prototype of g_signal_connect_object() to match.
> > > 
> > > I think it is confusing that g_signal_connect_object() vs.
> > > g_signal_connect() are not like gtk_signal_connect_object()
> > > vs. gtk_signal_connect().
> 
> > Yes, I thought about adding this to the list of things to
> > fix.
> > 
> > While g_signal_connect_object() is a reasonable name by
> > itself, the fact that it is something completely different
> > than gtk_signal_connect_object() is a problem.
> >  
> > > Maybe more a documentation than an API issue:
> > > 
> > > When would I use g_signal_connect_object()?
> > 
> > g_signal_connect_object() is a variant of g_signal_connect()
> > to be used when the 'data' object is a GObject. Using this
> > has two benefits:
> > 
> >  - Somewhat similar to gtk_signal_connect_while_alive(), 
> >    if the object passed as data goes away, the signal 
> >    connection will be removed.
> > 
> >  - While the signal is being invoked, an additional reference 
> >    count is added to the data object, possibly preventing 
> >    reentrancy problems.
> > 
> > As you point, unlike gtk_signal_connect_object(), 
> > g_signal_connect_object does NOT imply G_CONNECT_SWAPPED.
> > Which will definitely confuse people.
> 
> gtk_signal_connect_object() jsut needs to be deprecated, the
> name is misleading in the first place.

I don't disagree with either of these statements, but I don't
think deprecating gtk_signal_connect_object() makes 
g_signal_connect_object() an acceptable name. There is just
too much code out there using gtk_signal_connect_object(),
and too many people who know what it does.

Regards,
                                        Owen




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