@@ -165,7 +165,7 @@ def _create_badge_background(self) -> None:
165
165
if self ._background_group is None :
166
166
self ._background_group = displayio .Group ()
167
167
168
- self .show ( self ._background_group )
168
+ self .root_group = self ._background_group
169
169
170
170
if self ._background_image_filename :
171
171
file_handle = open ( # pylint: disable=consider-using-with
@@ -359,7 +359,7 @@ def show_custom_badge(self) -> None:
359
359
if not self ._created_background :
360
360
self ._create_badge_background ()
361
361
362
- self .show ( self ._background_group )
362
+ self .root_group = self ._background_group
363
363
364
364
# pylint: disable=too-many-arguments
365
365
def _create_label_group (
@@ -561,7 +561,7 @@ def show_business_card(
561
561
business_card_splash .append (face_image )
562
562
for group in business_card_label_groups :
563
563
business_card_splash .append (group )
564
- self .show ( business_card_splash )
564
+ self .root_group = business_card_splash
565
565
566
566
# pylint: disable=too-many-locals
567
567
def show_badge (
@@ -646,9 +646,15 @@ def show_badge(
646
646
group .append (hello_group )
647
647
group .append (my_name_is_group )
648
648
group .append (name_group )
649
- self .show ( group )
649
+ self .root_group = group
650
650
651
- def show (self , group ) -> None :
651
+ @property
652
+ def root_group (self ):
653
+ """The currently showing Group"""
654
+ return self .display .root_group
655
+
656
+ @root_group .setter
657
+ def root_group (self , group ):
652
658
"""Show the given group, refreshing the screen immediately"""
653
659
self .activity ()
654
660
self .display .auto_refresh = False
@@ -658,7 +664,7 @@ def show(self, group) -> None:
658
664
659
665
def show_terminal (self ) -> None :
660
666
"""Revert to terminalio screen."""
661
- self .show ( None )
667
+ self .root_group = displayio . CIRCUITPYTHON_TERMINAL
662
668
663
669
@staticmethod
664
670
def bitmap_qr (matrix : adafruit_miniqr .QRBitMatrix ) -> displayio .Bitmap :
@@ -710,7 +716,7 @@ def show_qr_code(self, data: str = "https://circuitpython.org") -> None:
710
716
)
711
717
qr_code = displayio .Group (scale = qr_code_scale )
712
718
qr_code .append (qr_img )
713
- self .show ( qr_code )
719
+ self .root_group = qr_code
714
720
715
721
@staticmethod
716
722
def _sine_sample (length : int ) -> Generator [int , None , None ]:
0 commit comments