Repository: adafruit/Adafruit_CircuitPython_ST7735R (language: python)

Issue:
Convert `.show()` to `.root_group =` for CircuitPython 9
in examples/ and README.rst


Discussion / hints:

Fix patch:
diff --git a/README.rst b/README.rst
index 501ad81..7aa2268 100644
--- a/README.rst
+++ b/README.rst
@@ -53,6 +53,7 @@ Usage Example
 
     import board
     import displayio
+    import fourwire
     from adafruit_st7735r import ST7735R
 
     spi = board.SPI()
@@ -60,13 +61,12 @@ Usage Example
     tft_dc = board.D6
 
     displayio.release_displays()
-    display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
+    display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
     display = ST7735R(display_bus, width=128, height=128, colstart=2, rowstart=1)
 
     # Make the display context
     splash = displayio.Group()
-    display.show(splash)
 
     color_bitmap = displayio.Bitmap(128, 128, 1)
     color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_128x160_colored_labels.py b/examples/st7735r_128x160_colored_labels.py
index 6c6f1ac..51a9051 100755
--- a/examples/st7735r_128x160_colored_labels.py
+++ b/examples/st7735r_128x160_colored_labels.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_st7735r import ST7735R
 
@@ -19,9 +20,7 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(
-    spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
-)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
 display = ST7735R(
     display_bus, width=160, height=80, colstart=24, rotation=270, bgr=False
@@ -29,7 +28,7 @@
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(160, 80, 1)
 color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_18tftshield_buttons.py b/examples/st7735r_18tftshield_buttons.py
index d2be580..368a593 100644
--- a/examples/st7735r_18tftshield_buttons.py
+++ b/examples/st7735r_18tftshield_buttons.py
@@ -7,6 +7,7 @@
 import time
 import board
 import displayio
+import fourwire
 from adafruit_seesaw.tftshield18 import TFTShield18
 from adafruit_st7735r import ST7735R
 
@@ -19,7 +20,7 @@
 tft_cs = board.D10
 tft_dc = board.D8
 
-display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
 
 ss.tft_reset()
 display = ST7735R(display_bus, width=160, height=128, rotation=90, bgr=True)


Test patch:
diff --git a/examples/st7735r_128x160_simpletest.py b/examples/st7735r_128x160_simpletest.py
index bfe9d2d..9b69ae0 100644
--- a/examples/st7735r_128x160_simpletest.py
+++ b/examples/st7735r_128x160_simpletest.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_st7735r import ST7735R
 
@@ -19,15 +20,13 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(
-    spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
-)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
 display = ST7735R(display_bus, width=160, height=128, rotation=90, bgr=True)
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(160, 128, 1)
 color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_minitft_featherwing_simpletest.py b/examples/st7735r_minitft_featherwing_simpletest.py
index 0ba6c3c..eaa565c 100644
--- a/examples/st7735r_minitft_featherwing_simpletest.py
+++ b/examples/st7735r_minitft_featherwing_simpletest.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_seesaw.seesaw import Seesaw
 from adafruit_st7735r import ST7735R
@@ -26,7 +27,7 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs)
 
 ss.digital_write(reset_pin, True)
 display = ST7735R(
@@ -35,7 +36,7 @@
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(160, 80, 1)
 color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_minitft_revb_simpletest.py b/examples/st7735r_minitft_revb_simpletest.py
index 034930a..d7e52a0 100644
--- a/examples/st7735r_minitft_revb_simpletest.py
+++ b/examples/st7735r_minitft_revb_simpletest.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_st7735r import ST7735R
 
@@ -19,9 +20,7 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(
-    spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
-)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
 display = ST7735R(
     display_bus,
@@ -35,7 +34,7 @@
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(160, 80, 1)
 color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_minitft_simpletest.py b/examples/st7735r_minitft_simpletest.py
index d883c30..d84c145 100644
--- a/examples/st7735r_minitft_simpletest.py
+++ b/examples/st7735r_minitft_simpletest.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_st7735r import ST7735R
 
@@ -19,9 +20,7 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(
-    spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
-)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
 display = ST7735R(
     display_bus, width=160, height=80, colstart=24, rotation=270, bgr=True
@@ -29,7 +28,7 @@
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(160, 80, 1)
 color_palette = displayio.Palette(1)
diff --git a/examples/st7735r_simpletest.py b/examples/st7735r_simpletest.py
index 080e35b..050dce5 100644
--- a/examples/st7735r_simpletest.py
+++ b/examples/st7735r_simpletest.py
@@ -9,6 +9,7 @@
 import board
 import terminalio
 import displayio
+import fourwire
 from adafruit_display_text import label
 from adafruit_st7735r import ST7735R
 
@@ -19,15 +20,13 @@
 tft_cs = board.D5
 tft_dc = board.D6
 
-display_bus = displayio.FourWire(
-    spi, command=tft_dc, chip_select=tft_cs, reset=board.D9
-)
+display_bus = fourwire.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=board.D9)
 
 display = ST7735R(display_bus, width=128, height=128, colstart=2, rowstart=1)
 
 # Make the display context
 splash = displayio.Group()
-display.show(splash)
+display.root_group = splash
 
 color_bitmap = displayio.Bitmap(128, 128, 1)
 color_palette = displayio.Palette(1)