demos/02_curses.py
changeset 83 ebe732b9ef19
child 84 04dfb5ddf031
equal deleted inserted replaced
82:2bead23b1262 83:ebe732b9ef19
       
     1 #!/usr/bin/env python3
       
     2 
       
     3 import sys
       
     4 sys.path.append('..')
       
     5 
       
     6 from tuikit.core.buffer import Buffer
       
     7 from tuikit.driver.curses import CursesDriver
       
     8 
       
     9 
       
    10 buffer = Buffer(16, 8)
       
    11 buffer.fill(c='#')
       
    12 buffer.hline(1, 1, 14, c='-')
       
    13 buffer.hline(1, 6, 14, c='-')
       
    14 buffer.vline(7, 2, 4, c='|')
       
    15 buffer.puts(8, 4, 'Hello!')
       
    16 buffer.frame()
       
    17 
       
    18 driver = CursesDriver()
       
    19 with driver:
       
    20     driver.draw(buffer)
       
    21     driver.draw(buffer, 20, 10)
       
    22     driver.stdscr.refresh()
       
    23     driver.stdscr.getch()
       
    24