def preferredSize(self, rowLimit, colLimit):
    return (min(rowLimit, len(self.textBuffer.lines)), colLimit)
def preferredSize(self, rowLimit, colLimit):
    return (min(rowLimit, len(self.textBuffer.lines)), colLimit)