File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class PortalBase:
55
55
56
56
"""
57
57
58
- # pylint: disable=too-many-instance-attributes, too-many-branches
58
+ # pylint: disable=too-many-instance-attributes, too-many-branches, too-many-public-methods
59
59
def __init__ (
60
60
self ,
61
61
network ,
@@ -213,6 +213,21 @@ def add_text(
213
213
214
214
# pylint: enable=too-many-arguments
215
215
216
+ def remove_all_text (self , clear_font_cache = False ):
217
+ """Remove all added text and labels.
218
+
219
+ :param bool clear_font_cache: Clear the font cache. Defaults to False.
220
+ """
221
+
222
+ # Remove the labels
223
+ for i in range (len (self ._text )):
224
+ self .set_text ("" , i )
225
+ # Remove the data
226
+ self ._text = []
227
+ if clear_font_cache :
228
+ self ._fonts = {}
229
+ gc .collect ()
230
+
216
231
def set_text (self , val , index = 0 ):
217
232
"""Display text, with indexing into our list of text boxes.
218
233
You can’t perform that action at this time.
0 commit comments