@@ -73,12 +73,8 @@ def __init__( # noqa: PLR0912,PLR0913 Too many branches,Too many arguments in f
73
73
self .network = network
74
74
"""The :py:class:`~adafruit_portalbase.NetworkBase`-derived instance provided"""
75
75
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
79
77
for this device."""
80
- self .display = self .graphics .display
81
- """The :py:class:`busdisplay.BusDisplay` object representing the screen for this device"""
82
78
83
79
# Font Cache
84
80
self ._fonts = {}
@@ -267,7 +263,7 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
267
263
string = string [: self ._text [index ]["maxlen" ] - 3 ] + "..."
268
264
else :
269
265
string = string [: self ._text [index ]["maxlen" ]]
270
- index_in_splash = None
266
+ index_in_root_group = None
271
267
272
268
if len (string ) > 0 and self ._text [index ]["wrap" ]:
273
269
if self ._debug :
@@ -278,7 +274,7 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
278
274
if self ._text [index ]["label" ] is not None :
279
275
if self ._debug :
280
276
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" ])
282
278
elif self ._debug :
283
279
print ("Creating text area with :" , string )
284
280
if len (string ) > 0 :
@@ -288,22 +284,22 @@ def set_text(self, val, index=0): # noqa: PLR0912 Too many branches
288
284
text = string ,
289
285
scale = self ._text [index ]["scale" ],
290
286
)
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" ]
293
289
else :
294
- self .splash .append (self ._text [index ]["label" ])
290
+ self .root_group .append (self ._text [index ]["label" ])
295
291
else :
296
292
self ._text [index ]["label" ].text = string
297
293
self ._text [index ]["label" ].color = self ._text [index ]["color" ]
298
294
self ._text [index ]["label" ].anchor_point = self ._text [index ]["anchor_point" ]
299
295
self ._text [index ]["label" ].anchored_position = self ._text [index ]["position" ]
300
296
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 :
302
298
self ._text [index ]["label" ] = None
303
299
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 ]
307
303
gc .collect ()
308
304
309
305
def preload_font (self , glyphs = None , index = 0 ):
@@ -552,3 +548,22 @@ def json_path(self, value):
552
548
self ._json_path = (value ,)
553
549
else :
554
550
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