'Connect to all the events we need.'

def connect(self):

    self.cidpress = self.cbar.patch.figure.canvas.mpl_connect('button_press_event', self.on_press)
    self.cidrelease = self.cbar.patch.figure.canvas.mpl_connect('button_release_event', self.on_release)
    self.cidmotion = self.cbar.patch.figure.canvas.mpl_connect('motion_notify_event', self.on_motion)
    self.keypress = self.cbar.patch.figure.canvas.mpl_connect('key_press_event', self.key_press)
    self.scroll = self.cbar.patch.figure.canvas.mpl_connect('scroll_event', self.on_scroll)
