#579906 whiptail: Add sensible run-time defaults for '--msgbox', et al.

Package:
whiptail
Source:
newt
Description:
Displays user-friendly dialog boxes from shell scripts
Submitter:
"A. Costa"
Date:
2010-05-02 08:27:05 UTC
Severity:
wishlist
#579906#5
Date:
2010-05-02 08:20:28 UTC
From:
To:
To get this to work:

    whiptail --msgbox "Text fitting takes trial & error." 7 38

...the user has to measure the text length, (33), add 5, (33+5=38), and
measure the lines, & add 6.

It'd be simpler if 'whiptail' calculated the 'height' and 'width'
automatically; for example:

    whiptail --msgbox "Text fitting takes trial & error."

Shell script kludge for impatient users:

    # one line of text only.
    whipmsg() { whiptail --msgbox "$1" 7 $(( ${#1} + 5 )) ; }
    whipmsg "hello world"

...but a better routine would allow for terminal width, and multi-line text..

The proposed syntax should also let users manually supply the 'height'
and 'width' options.

Similar defaults would be useful for most 'whiptail' options requiring
'height' and 'width'.

HTH...