From 1990806aabf851a9e6ab69707a9d56b70bca03b8 Mon Sep 17 00:00:00 2001 From: cube Date: Wed, 5 Mar 2025 11:37:48 +0000 Subject: [PATCH] Update 'CARDPUTER CircuitPython/full_display_test.py' --- CARDPUTER CircuitPython/full_display_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CARDPUTER CircuitPython/full_display_test.py b/CARDPUTER CircuitPython/full_display_test.py index 5070411..a77d9e1 100644 --- a/CARDPUTER CircuitPython/full_display_test.py +++ b/CARDPUTER CircuitPython/full_display_test.py @@ -24,5 +24,12 @@ while True: elif key == "CTRLD": text = "Press CTRL+D to clear text\n\n" else: + ## WRAPPING + ## calculate wrapping when entering a character + lines = text.split("\n") + current_line = lines[len(lines)-1] + if len(current_line) > 35: + text=text+"\n" # <- start a new line here + ############################################## text = text+key text_area.text = text \ No newline at end of file