mabe02 / lanterna

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

Question about number of columns and lines that fit without scroll bars? #614

Closed javafanboy closed 4 weeks ago

javafanboy commented 1 month ago

I would like to know how many columns and lines that fit within a multi line text box without scroll bars - is this possible?

mabe02 commented 1 month ago

You can decide how big you want it to be

javafanboy commented 1 month ago

The dimensions are given by screen size and layout manager and I want to make the width of the data to fit without scroll bars (by deciding what detail data to include etc). I suppose I by trial and error can find out how many columns to deduct from the set width of the text box etc but was curious if some more elegant way existed ....

On Mon, Oct 14, 2024, 09:50 mabe02 @.***> wrote:

You can decide how big you want it to be

— Reply to this email directly, view it on GitHub https://github.com/mabe02/lanterna/issues/614#issuecomment-2410320953, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXQF5M64HTBUKT5X2S3C3Z3NZSTAVCNFSM6AAAAABPOO6S7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJQGMZDAOJVGM . You are receiving this because you authored the thread.Message ID: @.***>

javafanboy commented 4 weeks ago

Seems there is currently no way to determine this other than trial and error. Luckily this is quite easy when we are talking whole character positions.