How to create a Scroll List/Scrollable Container of variable size buttons?
- June 20, 2022
- 2 replies
- 1421 views
I'd like to have a list of buttons that's scrollable, the number of buttons in the list can be changed at run time (it's essentially a list of errors, so errors may become active and inactive at any time), and I'd like to have the button height be variable depending on how long the text is in the button. I've attached a crude mockup.
I've searched these forums and couldn't find any questions dealing with the button size being variable. I followed Tutorial 4: Creating a Scroll Wheel with Custom Behavior, but I'm not sure how or if it's possible to change the size of a particular instance of a custom container on the fly.
I've also explored using a scrollable container widget instead of the scroll list. I would use button widgets and write the code to place and size the buttons within the scrollable container according to how many buttons I need and how large they need to be. Is this a better approach? I'm not sure if I could create buttons on the fly.
Thank you!