Re: Minor GClosure improvement



Murray Cumming <murrayc usa net> writes:

> Here's is a very minor GClosure improvement proposal to simplify the Gtk--
> binding, and possibly other bindings. It will have no effect on code that
> doesn't use it.
> 
> In GTK+, if you emit a signal that has a return value, and there are no
> callbacks connected and no default handler, then the return value will not be
> set at all.

This is no longer the case:

Fri Mar 30 07:34:02 2001  Tim Janik  <timj gtk org>

        [...]

	* gsignal.c (g_signal_emit_valist): always assign C return value
	location, people depending on unaltered return values after emissions
	that had no handlers to run need to use g_signal_emitv().

(Well, not normally the case, you can get this behavior with g_signal_emitv
if you _really_ need it.) 

But, in any case, this shouldn't be necessary in a bit, because one of
the main intents of the addition of closures is to enable overriding
the handling of the default handler.

That's what the 'class_closure' argument to g_signal_newv is for. 
Of course, currently, you can't override the class closure in derived
classes, but since that makes the whole thing pretty useful, I think
you can't count on that being fixed.

Regards,
                                            Owen




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