demos/demo_buffer.py
author Radek Brich <radek.brich@devl.cz>
Fri, 14 Mar 2014 08:44:15 +0100
changeset 79 dbdc38f9981a
parent 78 6031e99c8ad3
child 81 5cd40c30c4f2
permissions -rwxr-xr-x
Add attribute storage to Buffer.

#!/usr/bin/env python3

import sys
sys.path.append('..')

from tuikit.core.buffer import Buffer


buf = Buffer(16, 8)
buf.fill(c='#')
buf.hline(1, 1, 14, c='-')
buf.hline(1, 6, 14, c='-')
buf.vline(7, 2, 4, c='|')
buf.puts(8, 4, 'Hello!')

for y in range(buf.size.h):
    for x in range(buf.size.w):
        print(buf.get(x, y)[0], end='')
    print()