Skip to content

Commit 3de4dea

Browse files
authored
Merge pull request #16 from prcutler/root-group-fix
Update root_group for CP 9 compatibility
2 parents 01b5726 + bda8808 commit 3de4dea

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

examples/display_notification_eink_gizmo.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def find_connection():
3333
display = eink_gizmo.EInk_Gizmo()
3434

3535
radio_widget = AdvertisingWidget(radio.name, display.width, display.height)
36-
display.show(radio_widget)
36+
display.root_group = radio_widget
3737

3838
# True when the screen reflects our current state.
3939
screen_updated = False
@@ -77,16 +77,15 @@ def find_connection():
7777
print(new_notification)
7878
latest_notification = new_notification
7979
screen_updated = False
80-
display.show(
81-
apple.create_notification_widget(
82-
latest_notification, display.width, display.height
83-
)
80+
display.root_group = apple.create_notification_widget(
81+
latest_notification, display.width, display.height
8482
)
83+
8584
elif latest_notification and latest_notification.removed:
8685
# Stop showing the latest and show that there are no new notifications.
8786
latest_notification = None
8887
screen_updated = False
89-
display.show(NotificationFree(display.width, display.height))
88+
display.root_group = NotificationFree(display.width, display.height)
9089

9190
# Do not refresh the screen more often than every 180 seconds for eInk displays! Rapid
9291
# refreshes will damage the panel.

examples/display_notification_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def find_connection():
5454

5555
display = tft_gizmo.TFT_Gizmo()
5656
group = displayio.Group(scale=SCALE)
57-
display.show(group)
57+
display.root_group = group
5858

5959
width = display.width // SCALE
6060
height = display.height // SCALE

0 commit comments

Comments
 (0)