Remove previous entrances of a tab, and add it as the latest.

def remove_and_append(self, index):
        """Remove previous entrances of a tab, and add it as the latest."""
        while index in self:
            self.remove(index)
        self.append(index)