def on_mb_click(self, button, addr, mouse_offs): if button == Qt.MiddleButton: pass elif button == Qt.RightButton: self.switch ^= 1 print "Highlighting %s" % self.mode[self.switch]