This is the code than open a whiptail message box based on the content of the file in the file variable. The file has many lines.
$(whiptail --title "Opening file" --yesno "$(cat $file)" 78 78 3>&1 1>&2 2>&3)
Now the box is fixed in width and height. How to show a scrolling text box so I can see all of the text in the file?