[pygtk] How do I accumulate return values from a signal

samwyse samwyse at gmail.com
Tue Sep 29 20:25:45 WST 2009


My plug-in based application is coming along nicely now. I've defined
a few signals and the plug-ins are connecting successfully.  However,
this has led me to another question or two.

When my main program emits a signal, is there a best way to accumulate
the results returned by everything that is connected?  The
documentation refers to a gobject method that hints at doing this:
"The signal_accumulator_true_handled() function is only used as
accumulator argument when registering signals."  However, I see no
other references to "accumulator arguments" anywhere.  I've also
thought of passing, say, a list object as an extra parameter and
letting each plug-in append to the list before returning.

Finally, I intend to use the above to allow a plug-in to insert itself
into the GUI.  Maybe I'm taking the wrong approach.  Is there a better
way to allow a plug-in to insert action groups or add ui from a
string?

Thanks.


More information about the pygtk mailing list