@@ -73,12 +73,8 @@ def __init__( # noqa: PLR0912,PLR0913 Too many branches,Too many arguments in f
7373 self .network = network
7474 """The :py:class:`~adafruit_portalbase.NetworkBase`-derived instance provided"""
7575 self .graphics = graphics
76- """The :py:class:`~adafruit_portalbase.GraphicsBase`-derived instance provided"""
77- self .splash = self .graphics .splash
78- """The :py:meth:`displayio.Group()` object that acts as the splash screen
76+ """The :py:meth:`displayio.Group()` object that acts as the root group screen
7977 for this device."""
80- self .display = self .graphics .display
81- """The :py:class:`busdisplay.BusDisplay` object representing the screen for this device"""
8278
8379 # Font Cache
8480 self ._fonts = {}
@@ -267,7 +263,7 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
267263 string = string [: self ._text [index ]["maxlen" ] - 3 ] + "..."
268264 else :
269265 string = string [: self ._text [index ]["maxlen" ]]
270- index_in_splash = None
266+ index_in_root_group = None
271267
272268 if len (string ) > 0 and self ._text [index ]["wrap" ]:
273269 if self ._debug :
@@ -278,7 +274,7 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
278274 if self ._text [index ]["label" ] is not None :
279275 if self ._debug :
280276 print ("Replacing text area with :" , string )
281- index_in_splash = self .splash .index (self ._text [index ]["label" ])
277+ index_in_root_group = self .root_group .index (self ._text [index ]["label" ])
282278 elif self ._debug :
283279 print ("Creating text area with :" , string )
284280 if len (string ) > 0 :
@@ -288,22 +284,22 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
288284 text = string ,
289285 scale = self ._text [index ]["scale" ],
290286 )
291- if index_in_splash is not None :
292- self .splash [ index_in_splash ] = self ._text [index ]["label" ]
287+ if index_in_root_group is not None :
288+ self .root_group [ index_in_root_group ] = self ._text [index ]["label" ]
293289 else :
294- self .splash .append (self ._text [index ]["label" ])
290+ self .root_group .append (self ._text [index ]["label" ])
295291 else :
296292 self ._text [index ]["label" ].text = string
297293 self ._text [index ]["label" ].color = self ._text [index ]["color" ]
298294 self ._text [index ]["label" ].anchor_point = self ._text [index ]["anchor_point" ]
299295 self ._text [index ]["label" ].anchored_position = self ._text [index ]["position" ]
300296 self ._text [index ]["label" ].line_spacing = self ._text [index ]["line_spacing" ]
301- elif index_in_splash is not None :
297+ elif index_in_root_group is not None :
302298 self ._text [index ]["label" ] = None
303299
304- # Remove the label from splash
305- if index_in_splash is not None and self ._text [index ]["label" ] is None :
306- del self .splash [ index_in_splash ]
300+ # Remove the label from root group
301+ if index_in_root_group is not None and self ._text [index ]["label" ] is None :
302+ del self .root_group [ index_in_root_group ]
307303 gc .collect ()
308304
309305 def preload_font (self , glyphs = None , index = 0 ):
@@ -552,3 +548,22 @@ def json_path(self, value):
552548 self ._json_path = (value ,)
553549 else :
554550 self ._json_path = None
551+
552+ @property
553+ def root_group (self ):
554+ """The root display group for this device."""
555+ return self .graphics .root_group
556+
557+ @property
558+ def splash (self ):
559+ """The root display group for this device (for backwards compatibility)."""
560+ print (
561+ "WARNING: splash is deprecated, use root_group instead. "
562+ "This will be removed in a future release."
563+ )
564+ return self .graphics .root_group
565+
566+ @property
567+ def display (self ):
568+ """The displayio.Display object for this device."""
569+ return self .graphics .display
0 commit comments