@classmethod
def printtext(cls, text, printline, end_newline=True):
    """Uses the printline function to print a text spanning several lines."""
    lines = text.splitlines()
    for l in lines[:-1]:
        printline(l + '\n')
    if end_newline:
        printline(lines[-1] + '\n')
    else:
        printline(lines[-1])
