Skip to content

How to Create a Grid Layout? #2944

Closed Answered by freakboy3742
jorpyy asked this question in Q&A
Discussion options

You must be logged in to vote

At present, there isn't a native grid layout mechanism in Toga; See #2162 for the ticket tracking the feature request.

In the meantime, the best option is to have a column box, each of which contains a series of row boxes where each widget at position N has either (a) a fixed width, or (b) a common flex value.

In your example, you'd need to duplicate the container_box constructor so you're creating multiple ROW boxes (one for each row of the grid); you'd then add either width=N (for some value of N - say, 100), or flex=1 to upperCase and lowerCase. If you want the grid to be sized so that the first column is twice the size of the second column, you'd set flex=2 on upperCase, and flex=1 on l…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jorpyy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants