jroimartin / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
9.85k stars 610 forks source link

Grid layout support #183

Open sineatos opened 5 years ago

sineatos commented 5 years ago

Hello

I used gocui to build an application and I found that I have to adjust the size of each view manually when I resize terminal. However, the effect of manual adjustment isn't good.

I think it's excellent if gocui could include a grid layout like bootstrap which can adjust automatically when the size of terminal is changed.

Is there a plan to add this feature into gocui?

whereswaldon commented 5 years ago

I can't speak for @jroimartin, but I can say that adding something like that would be a colossal undertaking. Layout functions are complex. There's an example that implements a flow layout in the examples folder, but a grid has a lot more logic behind it.

However, such a thing could be built on top of gocui as a separate library. If you're interested in making this a reality, you could certainly build a LayoutManager that implemented a bootstrap-like grid by using a view naming convention (or similar) in place of CSS classes.