Skip to content

Commit 6f5d246

Browse files
authored
Merge pull request #2756 from dhalbert/show-to-root-group
replace .show(x) with .root_group = x
2 parents 44a84c5 + 24a0bde commit 6f5d246

File tree

16 files changed

+36
-49
lines changed

16 files changed

+36
-49
lines changed

CLUE_Light_Painter/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def load_image(self):
230230
board.DISPLAY.root_group = group
231231
sleep(4)
232232

233-
board.DISPLAY.show(displayio.Group()) # Clear display
233+
board.DISPLAY.root_group = displayio.Group() # Clear display
234234
self.clear_strip() # LEDs off
235235

236236

CLUE_Sensor_Plotter/plotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def display_on(self, tg_and_plot=None):
444444
if self._displayio_graph is None:
445445
self._displayio_graph = self._make_empty_graph(tg_and_plot=tg_and_plot)
446446

447-
self._output.show(self._displayio_graph)
447+
self._output.root_group = self._displayio_graph
448448

449449
def display_off(self):
450450
pass

CircuitPython_CLUEbot/robot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _init_ble(self):
6666
def _init_display(self):
6767
self.display = board.DISPLAY
6868
self.display_group = displayio.Group()
69-
self.display.show(self.display_group)
69+
self.display.root_group = self.display_group
7070
self.shape_color = 0
7171
self.bg_color = 0xFFFF00
7272
rect = vectorio.Rectangle(

CircuitPython_Display_Text/colormask_example/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
# Make the display context
2323
main_group = displayio.Group()
24-
display.show(main_group)
24+
display.root_group = main_group
2525

2626
font = bitmap_font.load_font("fonts/LeagueSpartan-Bold-16.bdf")
2727
reg_label = label.Label(

CircuitPython_Display_Text/scale_example/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# Make the display context
1717
main_group = displayio.Group()
18-
display.show(main_group)
18+
display.root_group = main_group
1919

2020
font = terminalio.FONT
2121

CircuitPython_PyPaint/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def __init__(self, display=board.DISPLAY):
211211
self._palette = self._make_palette()
212212
self._splash.append(self._palette)
213213

214-
self._display.show(self._splash)
214+
self._display.root_group = self._splash
215215
try:
216216
gc.collect()
217217
self._display.refresh(target_frames_per_second=60)

CircuitPython_Pyloton/pyloton.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,15 @@ def show_splash(self):
171171

172172
blinka_bitmap = "blinka-pyloton.bmp"
173173

174-
# Compatible with CircuitPython 6 & 7
175-
with open(blinka_bitmap, 'rb') as bitmap_file:
176-
bitmap1 = displayio.OnDiskBitmap(bitmap_file)
177-
tile_grid = displayio.TileGrid(bitmap1, pixel_shader=getattr(bitmap1, 'pixel_shader', displayio.ColorConverter()))
178-
self.loading_group.append(tile_grid)
179-
self.display.show(self.loading_group)
180-
status_heading = label.Label(font=self.arial16, x=80, y=175,
181-
text="Status", color=self.YELLOW)
182-
rect = Rect(0, 165, 240, 75, fill=self.PURPLE)
183-
self.loading_group.append(rect)
184-
self.loading_group.append(status_heading)
185-
186-
# # Compatible with CircuitPython 7+
187-
# bitmap1 = displayio.OnDiskBitmap(blinka_bitmap)
188-
# tile_grid = displayio.TileGrid(bitmap1, pixel_shader=bitmap1.pixel_shader)
189-
# self.loading_group.append(tile_grid)
190-
# self.display.show(self.loading_group)
191-
# status_heading = label.Label(font=self.arial16, x=80, y=175,
192-
# text="Status", color=self.YELLOW)
193-
# rect = Rect(0, 165, 240, 75, fill=self.PURPLE)
194-
# self.loading_group.append(rect)
195-
# self.loading_group.append(status_heading)
174+
bitmap1 = displayio.OnDiskBitmap(blinka_bitmap)
175+
tile_grid = displayio.TileGrid(bitmap1, pixel_shader=bitmap1.pixel_shader)
176+
self.loading_group.append(tile_grid)
177+
self.display.root_group = self.loading_group
178+
status_heading = label.Label(font=self.arial16, x=80, y=175,
179+
text="Status", color=self.YELLOW)
180+
rect = Rect(0, 165, 240, 75, fill=self.PURPLE)
181+
self.loading_group.append(rect)
182+
self.loading_group.append(status_heading)
196183

197184
def _load_fonts(self):
198185
"""
@@ -495,7 +482,7 @@ def setup_display(self):
495482

496483
self.splash.append(sprites)
497484

498-
self.display.show(self.splash)
485+
self.display.root_group = self.splash
499486
while self.loading_group:
500487
self.loading_group.pop()
501488

EInk_CircuitPython_Quickstart/27_tricolor_eink_shield_text/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
g.append(text_group)
7373

7474
# Place the display group on the screen
75-
display.show(g)
75+
display.root_group = g
7676

7777
# Refresh the display to have everything show on the display
7878
# NOTE: Do not refresh eInk displays more often than 180 seconds!

FunHouse_Fume_Extractor/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
text_font="fonts/Arial-Bold-24.pcf",
7575
)
7676
# showing graphics
77-
funhouse.display.show(funhouse.splash)
77+
funhouse.display.root_group = funhouse.splash
7878

7979
# state machines
8080
run = False # state if main code is running

MagTag/MagTag_Google_Calendar/authenticator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
label_user_code.text = "2. Enter code: %s" % google_auth.user_code
8282

8383
graphics.qrcode(google_auth.verification_url.encode(), qr_size=2, x=240, y=70)
84-
graphics.display.show(graphics.splash)
84+
graphics.display.root_group = graphics.splash
8585
display.refresh()
8686

8787
# Poll Google's authorization server

0 commit comments

Comments
 (0)