def METHOD_NAME(self, old, new):
    if new > old:
        for i in range(old, new):
            self._add_row(i)
    else:
        for i in range(new, old):
            self._remove_row(i)
    self.request_redraw()