[py] box() example.

This commit is contained in:
Alex Samuel 2022-02-13 18:14:08 -05:00
parent 776680f5af
commit 9cdcd283d0

View File

@ -0,0 +1,36 @@
from time import sleep
import notcurses as nc
notcurses = nc.Notcurses()
plane = notcurses.stdplane()
BOX_CHARS = (
nc.NCBOXASCII,
nc.NCBOXDOUBLE,
nc.NCBOXHEAVY,
nc.NCBOXLIGHT,
nc.NCBOXOUTER,
nc.NCBOXROUND,
)
CHANNELS = (
0,
0x0000000040808080, # default on grey
0x40ff000000000000, # red on default
0x4000ff00400000ff, # green on blue
)
SY = 7
SX = 10
for y, channels in enumerate(CHANNELS):
for x, box_chars in enumerate(BOX_CHARS):
nc.box(
plane, (y + 1) * SY - 1, (x + 1) * SX - 1, y * SY + 1, x * SX + 1,
box_chars,
channels=channels,
# ctlword=0x1f9
)
notcurses.render()
sleep(5)