diff --git a/CHANGELOG b/CHANGELOG index 07eca61726bd..1388900b81b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +2011-06-24 Added 'add_signal' to the CallbackRegistry. - BVR + 2011-06-16 Added *bottom* keyword parameter for the stem command. Also, implemented a legend handler for the stem plot. - JJL diff --git a/lib/matplotlib/cbook.py b/lib/matplotlib/cbook.py index 9335bf9ec4d5..ab9f93baba27 100644 --- a/lib/matplotlib/cbook.py +++ b/lib/matplotlib/cbook.py @@ -221,6 +221,16 @@ def _check_signal(self, s): signals.sort() raise ValueError('Unknown signal "%s"; valid signals are %s'%(s, signals)) + def add_signal(self, s) : + """ + Add another valid signal *s* to the registry. + If the signal already exists, no change is made. + """ + if s not in self.signals : + self.signals.add(s) + self.callbacks[s] = dict() + + def connect(self, s, func): """ register *func* to be called when a signal *s* is generated