Page 1 of 1

Row/columns for text mode app?

Posted: Wed Mar 13, 2013 3:56 am
by tonyhughes
I have an app that presents information via whiptail.

All my devices are fairly large screens - e.g. 1280x1024 or better, so I generally have a good number of rows and columns in text mode.

Some of my users are reporting usability problems, with portions of my screens being cut off, I presume because they have smaller displays/windows.

What number of rows/columns is safe to develop for/use as a minimum requirement?

Re: Row/columns for text mode app?

Posted: Wed Mar 13, 2013 11:22 am
by gordon@drogon.net
tonyhughes wrote:I have an app that presents information via whiptail.

All my devices are fairly large screens - e.g. 1280x1024 or better, so I generally have a good number of rows and columns in text mode.

Some of my users are reporting usability problems, with portions of my screens being cut off, I presume because they have smaller displays/windows.

What number of rows/columns is safe to develop for/use as a minimum requirement?
80x24.

Even then, on a Pi using composite video output to a crappy old TV it might be less than 80 wide. Assume 40x24.

-Gordon

Re: Row/columns for text mode app?

Posted: Wed Mar 13, 2013 11:24 am
by tonyhughes
Thanks :)

Re: Row/columns for text mode app?

Posted: Wed Mar 13, 2013 11:25 am
by rurwin
You can ask how big the screen is. I think it's probably in nCurses. That's how "more" knows how many lines to display at a time.

Re: Row/columns for text mode app?

Posted: Wed Mar 13, 2013 11:31 am
by gordon@drogon.net
rurwin wrote:You can ask how big the screen is. I think it's probably in nCurses. That's how "more" knows how many lines to display at a time.
In a bash script you can parse the output of

stty -a

the first line - e.g.

speed 38400 baud; rows 64; columns 80; line = 0;

has what you need.

not a lot of help if you want to display big boxes though! But there are *nix tools to help you - e.g. the fmt] command and so on. (I've never used whiptail, so don't know what it offers in that department)

-Gordon

Re: Row/columns for text mode app?

Posted: Wed Mar 13, 2013 2:09 pm
by rpdom
In bash you can use the shell variables LINES and COLUMNS to see how big the current screen/window is.