mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.27k stars 242 forks source link

Sizing issues with GridLayout + AbstractListBox when there's extra space #477

Closed AObuchow closed 4 years ago

AObuchow commented 4 years ago

Hey, I think I've encountered a similar issue to https://github.com/mabe02/lanterna/issues/384. I have a panel that has lots of extra space, and an AbstractListBox that's filled with a variable number of items. I want the AbstractListBox to use all available space using GridLayout, but I don't seem to be able to achieve this (it only uses the space required for the items in contains).

I'm giving the AbstractListBox the following layout data:

this.setLayoutData(
                GridLayout.createLayoutData(GridLayout.Alignment.FILL, GridLayout.Alignment.FILL, true, true, 1, 1));

Maybe I'm just doing something wrong? Or is this a limitation of AbstractListBox?

AObuchow commented 4 years ago

Nevermind it was my own mistake :P Fixed it finally! Sorry about that.