From 2ecdf22f84e003cdebc521ee016fdb3e04e2578f Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Mon, 7 Mar 2022 15:34:41 -0800 Subject: [PATCH] Added function to remove all text --- adafruit_portalbase/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/adafruit_portalbase/__init__.py b/adafruit_portalbase/__init__.py index 510784d..4868a15 100755 --- a/adafruit_portalbase/__init__.py +++ b/adafruit_portalbase/__init__.py @@ -55,7 +55,7 @@ class PortalBase: """ - # pylint: disable=too-many-instance-attributes, too-many-branches + # pylint: disable=too-many-instance-attributes, too-many-branches, too-many-public-methods def __init__( self, network, @@ -213,6 +213,15 @@ class PortalBase: # pylint: enable=too-many-arguments + def remove_all_text(self, clear_font_cache=False): + """Remove all added text. + + :param bool clear_font_cache: Clear the font cache. Defaults to False. + """ + self._text = [] + if clear_font_cache: + self._fonts = {} + def set_text(self, val, index=0): """Display text, with indexing into our list of text boxes.