Skip to content

override text property from parent on ScrollingLabel #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

FoamyGuy
Copy link
Contributor

This resolves #182

As was noted on a comment in the issue full_text was the property that was used to change the text rather than text like it is with BitmapLabel and Label. So the functionality to change text after creation does exist, but the property name used to do it is not the same as it is on the other Label types.

This was original done that way because I didn't know how to override parent properties while still being able to use the parent implementation of the property in some other parts of code. It turned out that we skirted around that issue by being able to call the internal _set_text() function directly rather than using the parents properties.

The change in this PR makes it so that scrolling_lbl.text will now function the same as scrolling_lbl.full_text which means it will change the text in the scrolling label as likely expected by users who try setting it.

…functionality matches Label and BitmapLabel more closely
Copy link
Contributor

@jposada202020 jposada202020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :). This work as expected. I used the script in issue #182 given by @VinceVega7. Now you are able to modify the text outside the constructor.

tested on

Adafruit CircuitPython 8.1.0-beta.0-19-gb6a761335-dirty on 2023-03-10; Adafruit PyPortal Titano with samd51j20

@jposada202020 jposada202020 merged commit 635ad4e into adafruit:main Mar 13, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 14, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.28.0 from 2.26.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#188 from FoamyGuy/scrolling_label_text_prop
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#187 from jposada202020/fixing_label_padding

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to update scrolling_label text outside constructor
2 participants