Skip to content
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

Allow an Object to span multiple cells In Grids #45

Open
marky1991 opened this issue Dec 25, 2020 · 3 comments
Open

Allow an Object to span multiple cells In Grids #45

marky1991 opened this issue Dec 25, 2020 · 3 comments

Comments

@marky1991
Copy link

I'm trying to implement a gui with a bar along the top and a separate bar along the right side. So I would like something like this:

______________
|_________|  |
|         |  |
|_________|_ |

(hopefully my ascii art doesn't get mangled)
So when going to implement this design, one obvious approach is to design it as a grid, with 2 rows and 2 columns. The top bar would simply go in (1,1), but the right bar would need to extend from (1 to 2, 2). This doesn't seem possible presently. It would be nice if grid supported this.

Lacking this functionality, the simplest approach seems to be to fall back on Board and just place the two bars relative to the top left, but this approach is also hitting issues. Any other suggestions on implementing this ui would be great if I"m missing something simple.

@marky1991
Copy link
Author

If it is all helpful, the latest commit on https://hg.sr.ht/~marky1991/eden/ is my attempt at achieving this, though using board instead. (It also doesn't work, complaining about the contents being too big for the GUI, trying to figure out why right now)

@kalekundert
Copy link
Contributor

I'll have to think more closely about how/whether to do this, but a quick comment I can make is that you can get the layout described above by nesting a VBox inside of an HBox. I think that'd be easier and more robust than trying to use Board.

I wasn't able to access the commit you linked (I got a 401 Unauthorized error).

@marky1991
Copy link
Author

I didn't think of that, that's probably a workable solution. I still think that grid supporting this would be nice, but it does seem that all complicated cell-merging designs can probably be implemented as some combination of vboxes and hboxes, so at least it's doable with no changes.

I've since gotten the board strategy to work, though I had to work around lots of things that seemed like bugs (e.g. adding to the board relative to the top left failed when starting from the buttom left worked), though it's possible that I was misunderstanding how the board was supposed to use.

Once I get some time, I'll try to reimplement the gui as suggested and see how that goes.

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

No branches or pull requests

2 participants