Replies: 1 comment
-
our GridLayout does not yet support iteration, so one way to do it is to implement grid yourself by setting the geometry manually. slint/examples/printerdemo/ui/home_page.slint Lines 53 to 69 in e232648 slint/examples/memory/memory.slint Lines 106 to 117 in e232648 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For my app, I have rooms with some information in a struct about them that are on different floors. These rooms can change for different building, so I want to find a way to based on for example a 2d list, display the rooms in a grid view (or for example a vertical layout with a horizontal layout in each vertical layout) where a row is rooms in a floor.
I've found that it's difficult to do this as for example the
GridBox
don't allow for loops. What i'd like to do is writing something like this (extremely roughly):For context, the room names are now like
["101", "102", "201", "202"]
.Another way i've tried to do is like this:
However, then I need to make the floors-data in the correct way in rust, which has proven hard to me with my limited Slint knowledge. I was able to use rust to make a list of
StandardListViewItem
items to use in aStandardTableView
, but this was easier to do, as I was able to do it.The only help i've tried to now is chatGPT, which has limited Slint knowledge, so it has unremarkably made tons of mistakes, and often hallucinates, as can be expected.
So my question would be if there is an easy way to do this; take a vector of a struct (or string for simplicity's sake) and make that into a grid view.
I can provide my attempt with more specific code details if anyone would be so kind to aid me in this issue.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions