3 # This file contains a simple test program for demonstrating some basic Python
8 with btui.open() as bt:
11 while key != 'q' and key != 'Ctrl-c':
14 input("Press enter to continue.")
20 with bt.fg(.8, .95, .2):
21 bt.outline_box(x, y, 30, 1)
23 bt.write(f"Pressed: {key}")
25 title = "Python BTUI Demo"
27 center = (bt.width - w) // 2
28 with bt.attributes("fg_blue", "bg_normal"):
29 bt.draw_shadow(center - 2, 0, w + 4, 3)
30 with bt.attributes("bg_blue", "fg_black"):
31 bt.fill_box(center - 2, 0, w + 4, 3)
35 with bt.attributes("bold"):
36 bt.move(0, bt.height-1)
37 bt.write("Press 'q' to quit")
39 with bt.attributes("faint"):
40 s = f"Size: ({bt.width}x{bt.height})"
41 bt.move(bt.width-len(s), bt.height-1)
44 key, mx, my = bt.getkey()
49 raise KeyboardInterrupt