Skip to content

Commit 2ecdf22

Browse files
committed
Added function to remove all text
1 parent 01f050e commit 2ecdf22

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

adafruit_portalbase/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class PortalBase:
5555
5656
"""
5757

58-
# pylint: disable=too-many-instance-attributes, too-many-branches
58+
# pylint: disable=too-many-instance-attributes, too-many-branches, too-many-public-methods
5959
def __init__(
6060
self,
6161
network,
@@ -213,6 +213,15 @@ def add_text(
213213

214214
# pylint: enable=too-many-arguments
215215

216+
def remove_all_text(self, clear_font_cache=False):
217+
"""Remove all added text.
218+
219+
:param bool clear_font_cache: Clear the font cache. Defaults to False.
220+
"""
221+
self._text = []
222+
if clear_font_cache:
223+
self._fonts = {}
224+
216225
def set_text(self, val, index=0):
217226
"""Display text, with indexing into our list of text boxes.
218227

0 commit comments

Comments
 (0)