-
Notifications
You must be signed in to change notification settings - Fork 38
Width property not working in some cases #155
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
Comments
I tested this minimal example: import board
import terminalio
from adafruit_display_text import bitmap_label
text = "Hello world"
text_area = bitmap_label.Label(terminalio.FONT, text=text)
text_area.x = 10
text_area.y = 10
board.DISPLAY.show(text_area)
print(text_area.width)
while True:
pass It does print the width and does not raise an AttributeError. So this is somehow tied into the usage inside of grid_layout. Trying that out next to see if I can find a minimal reproducer. |
The way I did the width and height properties on Investigating further as well but I don't have a MacroPad, so I'll have to knock up a similar but different test. |
Yep, I think you are right. GridLayout is trying to set them and that is causing the error. In the old version they existed as class variables (unsure if proper term) which allowed them to be set even though it did not have a real effect. I think the best solution for now will be to catch the error in GridLayout. I'm going to try that out on the stream today. |
It turned out this needed to be fixed inside the DisplayIO_Layout library. The PR to resolve this is here: adafruit/Adafruit_CircuitPython_DisplayIO_Layout#42 |
Ref: adafruit/Adafruit_CircuitPython_MacroPad#10
Width and height properties do exist in LabelBase. I'm not sure why it's raising AttributeNotFound in this context.
I am looking into it further and working on a fix now.
The text was updated successfully, but these errors were encountered: