Skip to content

Commit 1aa3f6a

Browse files
toolforgerthomasballinger
authored andcommitted
Improve code example in readme.md
Bug fix: It wouldn't display the "Press escape to exit" message initially (made me believe it's not working at all).
1 parent 7f86c07 commit 1aa3f6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ from curtsies import FullscreenWindow, Input, FSArray
1313
from curtsies.fmtfuncs import red, bold, green, on_blue, yellow
1414

1515
print(yellow('this prints normally, not to the alternate screen'))
16+
1617
with FullscreenWindow() as window:
18+
a = FSArray(window.height, window.width)
19+
msg = red(on_blue(bold('Press escape to exit, space to clear.')))
20+
a[0:1, 0:msg.width] = [msg]
21+
window.render_to_terminal(a)
1722
with Input() as input_generator:
18-
msg = red(on_blue(bold('Press escape to exit')))
19-
a = FSArray(window.height, window.width)
20-
a[0:1, 0:msg.width] = [msg]
2123
for c in input_generator:
2224
if c == '<ESC>':
2325
break

0 commit comments

Comments
 (0)