From bd5a7281e54bb9eecfc7949e90acd0ba29c17952 Mon Sep 17 00:00:00 2001 From: RetiredWizard Date: Thu, 2 Nov 2023 00:37:22 -0400 Subject: [PATCH] replace depreciated .show() --- examples/display_text_advance_example.py | 88 +++++++++---------- examples/display_text_anchored_position.py | 2 +- examples/display_text_background_color.py | 2 +- .../display_text_background_color_padding.py | 4 +- .../display_text_bitmap_label_simpletest.py | 2 +- ...ay_text_label_align_baseline_comparison.py | 2 +- ...y_text_label_vs_bitmap_label_comparison.py | 4 +- examples/display_text_magtag.py | 2 +- examples/display_text_matrixportal.py | 2 +- examples/display_text_pyportal.py | 2 +- examples/display_text_scrolling_label.py | 2 +- examples/display_text_simpletest.py | 2 +- examples/display_text_textarea_boundingbox.py | 2 +- examples/display_text_wrap_pixels_test.py | 2 +- examples/display_text_wraptest.py | 2 +- 15 files changed, 60 insertions(+), 60 deletions(-) diff --git a/examples/display_text_advance_example.py b/examples/display_text_advance_example.py index 6e8c81e..38072c7 100644 --- a/examples/display_text_advance_example.py +++ b/examples/display_text_advance_example.py @@ -34,13 +34,13 @@ # Tests text_area = label.Label(terminalio.FONT, text="Circuit Python") main_group.append(text_area) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing position setter text_area.x = 10 text_area.y = 10 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing creating label with initial position @@ -57,7 +57,7 @@ background_color=0x004499, ) main_group.append(warning_text) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_area.text = "Testing Position" @@ -65,27 +65,27 @@ terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2 ) main_group.append(text_middle) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing Text Setter text_area.text = "Testing Changing Text" text_middle.text = "Python" -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing a and y getter and setter text_area.text = "Testing Changing Position" text_middle.x = text_middle.x - 50 text_middle.y = text_middle.y - 50 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing font Getter and setter text_area.text = "Testing Changing FONT" if isinstance(text_middle.font, fontio.BuiltinFont): text_middle.font = MEDIUM_FONT -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Once this working we create another label with all the initial specs @@ -100,11 +100,11 @@ y=display.height // 2, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.color = 0x004400 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -118,11 +118,11 @@ color=0xFFFFFF, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.background_color = 0x990099 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -148,7 +148,7 @@ background_tight=False, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() main_group.pop() @@ -168,7 +168,7 @@ padding_left=10, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -187,7 +187,7 @@ padding_left=10, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) try: @@ -206,7 +206,7 @@ ) main_group.append(warning_text) time.sleep(TIME_PAUSE) - display.show(main_group) + display.root_group = main_group main_group.pop() @@ -227,11 +227,11 @@ anchor_point=(0.5, 0.5), ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.scale = 2 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -257,7 +257,7 @@ base_alignment=True, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() main_group.pop() @@ -280,7 +280,7 @@ label_direction="UPR", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -301,7 +301,7 @@ label_direction="DWR", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -322,7 +322,7 @@ label_direction="TTB", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -343,23 +343,23 @@ label_direction="RTL", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() main_group.pop() # Testing creating label with initial position -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_area = bitmap_label.Label(terminalio.FONT, text="Circuit Python") main_group.append(text_area) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing position setter text_area.x = 10 text_area.y = 10 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_area.text = "Testing initiating without text" try: @@ -381,20 +381,20 @@ terminalio.FONT, text="Circuit", x=display.width // 2, y=display.height // 2 ) main_group.append(text_middle) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing Text Setter text_area.text = "Testing Changing Text" text_middle.text = "Python" -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing a and y getter and setter text_area.text = "Testing Changing Position" text_middle.x = text_middle.x - 50 text_middle.y = text_middle.y - 50 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Testing font Getter and setter @@ -402,7 +402,7 @@ if isinstance(text_middle.font, fontio.BuiltinFont): print("Font was BuiltinFont") text_middle.font = MEDIUM_FONT -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) # Once this working we create another label with all the initial specs @@ -417,11 +417,11 @@ y=display.height // 2, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.color = 0x004400 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -435,11 +435,11 @@ color=0xFFFFFF, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.background_color = 0x990099 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -465,7 +465,7 @@ background_tight=False, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() main_group.pop() @@ -485,7 +485,7 @@ padding_left=10, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -504,7 +504,7 @@ padding_left=10, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) try: @@ -523,7 +523,7 @@ ) main_group.append(warning_text) time.sleep(TIME_PAUSE) - display.show(main_group) + display.root_group = main_group main_group.pop() @@ -544,11 +544,11 @@ anchor_point=(0.5, 0.5), ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) text_initial_specs.scale = 2 -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -574,7 +574,7 @@ base_alignment=True, ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() main_group.pop() @@ -597,7 +597,7 @@ label_direction="UPR", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -618,7 +618,7 @@ label_direction="DWR", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -639,7 +639,7 @@ label_direction="UPD", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() @@ -660,7 +660,7 @@ label_direction="RTL", ) main_group.append(text_initial_specs) -display.show(main_group) +display.root_group = main_group time.sleep(TIME_PAUSE) main_group.pop() diff --git a/examples/display_text_anchored_position.py b/examples/display_text_anchored_position.py index 474993c..9fe48ff 100644 --- a/examples/display_text_anchored_position.py +++ b/examples/display_text_anchored_position.py @@ -60,7 +60,7 @@ text_group.append(text_area_bottom_left) text_group.append(text_area_bottom_right) -board.DISPLAY.show(text_group) +board.DISPLAY.root_group = text_group while True: pass diff --git a/examples/display_text_background_color.py b/examples/display_text_background_color.py index 542ca9b..4dfa1fc 100644 --- a/examples/display_text_background_color.py +++ b/examples/display_text_background_color.py @@ -18,7 +18,7 @@ print("background color is {:06x}".format(text_area.background_color)) -board.DISPLAY.show(text_area) +board.DISPLAY.root_group = text_area time.sleep(2) text_area.background_color = 0xFF0000 diff --git a/examples/display_text_background_color_padding.py b/examples/display_text_background_color_padding.py index a912b9d..8b9e29e 100755 --- a/examples/display_text_background_color_padding.py +++ b/examples/display_text_background_color_padding.py @@ -67,7 +67,7 @@ native_frames_per_second=90, ) -display.show(None) +display.root_group = None # font=terminalio.FONT # this is the Builtin fixed dimension font @@ -82,7 +82,7 @@ display.auto_refresh = True myGroup = displayio.Group() -display.show(myGroup) +display.root_group = myGroup text_area = [] myPadding = 4 diff --git a/examples/display_text_bitmap_label_simpletest.py b/examples/display_text_bitmap_label_simpletest.py index 6f15ed8..49b20b9 100644 --- a/examples/display_text_bitmap_label_simpletest.py +++ b/examples/display_text_bitmap_label_simpletest.py @@ -10,6 +10,6 @@ text_area = bitmap_label.Label(terminalio.FONT, text=text) text_area.x = 10 text_area.y = 10 -board.DISPLAY.show(text_area) +board.DISPLAY.root_group = text_area while True: pass diff --git a/examples/display_text_label_align_baseline_comparison.py b/examples/display_text_label_align_baseline_comparison.py index 7d650fc..6ebe843 100644 --- a/examples/display_text_label_align_baseline_comparison.py +++ b/examples/display_text_label_align_baseline_comparison.py @@ -69,7 +69,7 @@ ) main_group.append(right_text_aligned) -display.show(main_group) +display.root_group = main_group while True: pass diff --git a/examples/display_text_label_vs_bitmap_label_comparison.py b/examples/display_text_label_vs_bitmap_label_comparison.py index 1a15a4b..f4d107c 100644 --- a/examples/display_text_label_vs_bitmap_label_comparison.py +++ b/examples/display_text_label_vs_bitmap_label_comparison.py @@ -89,7 +89,7 @@ ) # reset the display to show nothing. - display.show(None) + display.root_group = None print("Display is started") @@ -219,6 +219,6 @@ display.auto_refresh = True -display.show(main_group) +display.root_group = main_group while True: pass diff --git a/examples/display_text_magtag.py b/examples/display_text_magtag.py index 24b50e3..bb59156 100644 --- a/examples/display_text_magtag.py +++ b/examples/display_text_magtag.py @@ -65,7 +65,7 @@ main_group.append(another_text) # show the main group and refresh. -display.show(main_group) +display.root_group = main_group display.refresh() while True: pass diff --git a/examples/display_text_matrixportal.py b/examples/display_text_matrixportal.py index a7ee865..fb0923f 100644 --- a/examples/display_text_matrixportal.py +++ b/examples/display_text_matrixportal.py @@ -21,6 +21,6 @@ text_area = label.Label(terminalio.FONT, text=text) text_area.x = 1 text_area.y = 4 -display.show(text_area) +display.root_group = text_area while True: pass diff --git a/examples/display_text_pyportal.py b/examples/display_text_pyportal.py index 3691ec8..6b95bce 100644 --- a/examples/display_text_pyportal.py +++ b/examples/display_text_pyportal.py @@ -31,7 +31,7 @@ demos = ["CircuitPython = Code + Community", "accents - üàêùéáçãÍóí", "others - αψ◌"] splash = displayio.Group() -board.DISPLAY.show(splash) +board.DISPLAY.root_group = splash max_y = 0 y = 0 for demo_text in demos: diff --git a/examples/display_text_scrolling_label.py b/examples/display_text_scrolling_label.py index 4bfdf43..02fd4cc 100644 --- a/examples/display_text_scrolling_label.py +++ b/examples/display_text_scrolling_label.py @@ -12,6 +12,6 @@ ) my_scrolling_label.x = 10 my_scrolling_label.y = 10 -board.DISPLAY.show(my_scrolling_label) +board.DISPLAY.root_group = my_scrolling_label while True: my_scrolling_label.update() diff --git a/examples/display_text_simpletest.py b/examples/display_text_simpletest.py index e27f3be..7a367bf 100644 --- a/examples/display_text_simpletest.py +++ b/examples/display_text_simpletest.py @@ -10,6 +10,6 @@ text_area = label.Label(terminalio.FONT, text=text) text_area.x = 10 text_area.y = 10 -board.DISPLAY.show(text_area) +board.DISPLAY.root_group = text_area while True: pass diff --git a/examples/display_text_textarea_boundingbox.py b/examples/display_text_textarea_boundingbox.py index f5e6c3a..46047ea 100644 --- a/examples/display_text_textarea_boundingbox.py +++ b/examples/display_text_textarea_boundingbox.py @@ -27,7 +27,7 @@ ########################################################################## # Make the display context splash = displayio.Group() -board.DISPLAY.show(splash) +board.DISPLAY.root_group = splash # Make a background color fill color_bitmap = displayio.Bitmap(320, 240, 1) diff --git a/examples/display_text_wrap_pixels_test.py b/examples/display_text_wrap_pixels_test.py index 811abb1..29f6a17 100644 --- a/examples/display_text_wrap_pixels_test.py +++ b/examples/display_text_wrap_pixels_test.py @@ -25,7 +25,7 @@ # Make the display context main_group = displayio.Group() -display.show(main_group) +display.root_group = main_group font = terminalio.FONT diff --git a/examples/display_text_wraptest.py b/examples/display_text_wraptest.py index 4f9489d..5286694 100644 --- a/examples/display_text_wraptest.py +++ b/examples/display_text_wraptest.py @@ -24,6 +24,6 @@ text_area = label.Label(terminalio.FONT, text=text) text_area.x = 10 text_area.y = 10 -display.show(text_area) +display.root_group = text_area while True: pass