Re: signal emit functions



On Fri, 2001-09-21 at 23:16, Owen Taylor wrote:
> 
> murrayc t-online de (Murray Cumming) writes:
> 
> > Some signals have associated emit functions. For instance,
> > GtkAdjustment::changed has gtk_adjustment_changed(). Do these functions
> > *ever* do anything other than just emitting the signal? Or are they just
> > syntactic sugar?
> > 
> > This isn't important to most people - I'm just trying to simplify Gtk--.
> 
> This has been a peristant problem with Gtk-- I'm afraid.

Luckily we can now fix stuff with an API change. Sometimes you've got to
do things wrong to find out that they're wrong.

> Only a _tiny_ subset of GTK+ signals can be emitted directly.
> These are the signals marked with the GTK_RUN_ACTION flag.

Then I'll try to remove that functionality from the new version. I'm not
aware of anybody using it anyway.

> And emitting these signals directly is generally not useful either
> because they are almost always meant for use by keybindings.
> 
> In every other case, the signals of an object are emitted
> only when that object intends to.
> 
> That is, the changed() method of GtkAdjustment:
> 
>  - Is documented (or should be documented) to cause ::changed
>    to be emitted.
> 
>  - _Happens_ to do nothing else, currently.
> 
> But in no other other way is connected with the ::changed signal
> as all. As far as the object system is concerned, it could just
> as well cause the ::frobated signal to be emitted, or cause
> the value of the adjustment be set to zero.

You really thing that we shouln't associate changed() with the changed
signal in the API? changed() isn't a very descriptive function name if
it isn't meant to suggest an association with the signal of the same
name.
 
> If a language binding maps signals directly into the objet namespace,
> conflicts may occur that have to be resolved in some fashion,
> but as far as GtkObject is concerned signals are in a completely
> independent namespace from methods.

Thanks for the information.





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