[Gtk-sharp-list] "format-value" signal in Gtk.Scale

Miguel de Icaza miguel@ximian.com
25 Mar 2003 16:24:37 -0500


Hello,

> The main use case for return values in Gtk+ signals is to stop emission
> via a true return from a bool callback. The way S.W.F handles similar
> tasks (like canceling an action from an event delegate) is by using
> properties in EventArgs subclasses.  So I chose the RetVal approach to
> follow this S.W.F practice of sticking to void delegates and using the
> args to feed back info to the caller.

Signal return values are useful on its own.  

In the *particular* case of Gdk events propagated in GtkWidget, in fact
the return value controls whether the emission should continue or not. 

But in the return value is not always used for this.

Stopping an emission in Glib/Gtk is independent of the Widget event
propagation system, and there is a special API to stop these emissions
(we discussed on the list a couple of weeks ago a proposal to support
this as well with Gtk#)

> If somebody feels strongly enough that RetVal is the most evil thing
> ever, I encourage them to rewrite the signalhandler generation code to
> produce non-void delegates and get rid of RetVal, and I'll gladly review
> the patch for inclusion if for no other reason than to never have this
> discussion again.  :)

I would love to do so myself, but I do lack the Perl knowledge and to
this day, I have problems following the Perl code.

But I will trade it for immediate sypport for your favorite bug reports
;-)