Closed diego-wh closed 5 months ago
wanna submit a PR? @makermelissa can review when she returns in a couple weeks
I could try to take a look at it over the weekend.
I don't have a MagTag with me, but it should just be a matter of adding an override function to this library.
Portalbase has a function to remove all text (remove_all_text) this calls self.set_text to clear the labels. Since magtag overrides this call to add the option to do a refresh ( auto_refresh: bool = True ) it would be nice to have an override of this function that takes the auto_refresh parameter. If we have more than a couple of labels (text fields) it is likely we will get the Refresh too soon exception. The code change should be relatively simple (same as parent just passing the extra parameter to set_text). I am unsure if this is part of the scope for this library. I could not find an easy way to remove all objects from the display (maybe I am missing something), but that may be a suitable workaround. I have been using a work around for my code
where count_labels is a simple counter that increments every time I call add_text. but in this case I don't get the benefit of deleting the _text list ( self._text = [] ).