Skip to content

Width and height could be made public #15

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

Closed
FoamyGuy opened this issue Aug 15, 2020 · 0 comments · Fixed by #16
Closed

Width and height could be made public #15

FoamyGuy opened this issue Aug 15, 2020 · 0 comments · Fixed by #16

Comments

@FoamyGuy
Copy link
Contributor

FoamyGuy commented Aug 15, 2020

We currently have stored width and height in private properties whose names start with underscore:

I think width and height should be provided without the leading underscore. It's very useful to know a views size when trying to place other views "after" or "around" it on the screen. I have a specific example of where this comes into play in my display_layout library here where I am trying to use the size of the view to determine where to place the next view in a vertical or horizontal list on the screen.

Some of the other existing displayio view widgets do provide public access to width and height:

adafruit_display_button provides it's width and height with no leading underscore: adafruit_button.py#L106

adafruit_display_text provides width and height via the public property bounding_box: label.py#L303

OnDiskBitmap and the object that results from adafruit_imageload.load() also have public width and height

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 a pull request may close this issue.

1 participant