'Event handler that will be passed to the current figure to
retrieve events.'

def on_event(self, event):

    self.add_event(event)
    verbose.report((u'Event    %i' % len(self.events)))
    self.post_event()
    if ((len(self.events) >= self.n) and (self.n > 0)):
        self.fig.canvas.stop_event_loop()
