xref: /freebsd-src/contrib/dialog/samples/inputbox7 (revision a96ef4501919d7ac08e94e98dc34b0bdd744802b)
14c8945a0SNathan Whitehorn#!/bin/sh
2*a96ef450SBaptiste Daroussin# $Id: inputbox7,v 1.9 2020/11/26 00:09:12 tom Exp $
34c8945a0SNathan Whitehorn# An example which produces two widget outputs.
44c8945a0SNathan Whitehorn
54c8945a0SNathan Whitehorn. ./setup-vars
64c8945a0SNathan Whitehorn
74c8945a0SNathan WhitehornMSG='Hi, this is an input dialog box. You can use \n
84c8945a0SNathan Whitehornthis to ask questions that require the user \n
94c8945a0SNathan Whitehornto input a string as the answer. You can \n
104c8945a0SNathan Whitehorninput strings of length longer than the \n
114c8945a0SNathan Whitehornwidth of the input box, in that case, the \n
124c8945a0SNathan Whitehorninput field will be automatically scrolled. \n
134c8945a0SNathan WhitehornYou can use BACKSPACE to correct errors. \n\n
144c8945a0SNathan WhitehornTry entering your name below:'
154c8945a0SNathan Whitehorn
164c8945a0SNathan Whitehorn# separate with a line-break (newline)
174c8945a0SNathan WhitehornSEP='
184c8945a0SNathan Whitehorn'
194c8945a0SNathan Whitehorn
204c8945a0SNathan Whitehornexec 3>&1
21*a96ef450SBaptiste Daroussinreturntext=`$DIALOG --title "INPUT BOX" --clear --separate-widget "$SEP" "$@" \
224c8945a0SNathan Whitehorn        --inputbox "$MSG" 16 51 \
234c8945a0SNathan Whitehorn	--title "ANOTHER INPUT BOX" \
244c8945a0SNathan Whitehorn        --inputbox "$MSG" 16 51 \
254c8945a0SNathan Whitehorn2>&1 1>&3`
26*a96ef450SBaptiste Daroussinreturncode=$?
274c8945a0SNathan Whitehornexec 3>&-
284c8945a0SNathan Whitehorn
294c8945a0SNathan Whitehorn. ./report-string
30