sdlterm/demo.py
author Radek Brich <radek.brich@devl.cz>
Sun, 27 Jan 2013 12:54:52 +0100
changeset 69 4e7be77bafff
parent 48 1f00e90fd72a
permissions -rwxr-xr-x
Add sdlterm to setup.py. Simplify color description, allow missing bg.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sdlterm import SDLTerminal

if __name__ == '__main__':
    term = SDLTerminal()
    term.resize(800, 600)
    term.select_font(b"font/DejaVuSansMono.ttf", b"font/DejaVuSansMono-Bold.ttf", 12)
    term.erase()
    term.putch(5, 5, 'W')
    term.commit()

    while True:
        event = term.wait_event()
        print(event)
        if event[0] == 'keypress' and event[1] == 'escape':
            break