#! /bin/sh # $Id: form1,v 1.15 2011/10/04 23:36:53 tom Exp $ . ./setup-vars DIALOG_ERROR=254 export DIALOG_ERROR backtitle="An Example for the use of --form:" ids=`id|sed -e 's/([^)]*)//g'` uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'` gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'` user="$USER" home="$HOME" returncode=0 while test $returncode != 1 && test $returncode != 250 do exec 3>&1 value=`$DIALOG --ok-label "Submit" \ --backtitle "$backtitle" "$@" \ --form "Here is a possible piece of a configuration program." \ 20 50 0 \ "Username:" 1 1 "$user" 1 10 10 0 \ "UID:" 2 1 "$uid" 2 10 8 0 \ "GID:" 3 1 "$gid" 3 10 8 0 \ "HOME:" 4 1 "$home" 4 10 40 0 \ 2>&1 1>&3` returncode=$? exec 3>&- show=`echo "$value" |sed -e 's/^/ /'` case $returncode in $DIALOG_CANCEL) "$DIALOG" \ --clear \ --backtitle "$backtitle" \ --yesno "Really quit?" 10 30 case $? in $DIALOG_OK) break ;; $DIALOG_CANCEL) returncode=99 ;; esac ;; $DIALOG_OK) "$DIALOG" \ --clear \ --backtitle "$backtitle" --no-collapse --cr-wrap \ --msgbox "Resulting data:\n\ $show" 10 40 ;; $DIALOG_HELP) echo "Button 2 (Help) pressed." exit ;; $DIALOG_EXTRA) echo "Button 3 (Extra) pressed." exit ;; $DIALOG_ERROR) echo "ERROR!$value" exit ;; $DIALOG_ESC) echo "ESC pressed." exit ;; *) echo "Return code was $returncode" exit ;; esac done
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
calendar | File | 229 B | 0755 |
|
calendar-stdout | File | 215 B | 0755 |
|
calendar2 | File | 221 B | 0755 |
|
calendar2-stdout | File | 207 B | 0755 |
|
checklist | File | 1004 B | 0755 |
|
checklist-utf8 | File | 1.08 KB | 0755 |
|
checklist10 | File | 815 B | 0755 |
|
editbox | File | 1.01 KB | 0755 |
|
editbox-utf8 | File | 852 B | 0755 |
|
editbox2 | File | 1.05 KB | 0755 |
|
form1 | File | 1.39 KB | 0755 |
|
form2 | File | 2.14 KB | 0755 |
|
fselect | File | 214 B | 0755 |
|
fselect-stdout | File | 199 B | 0755 |
|
fselect1 | File | 322 B | 0755 |
|
fselect1-stdout | File | 308 B | 0755 |
|
fselect2 | File | 212 B | 0755 |
|
fselect2-stdout | File | 198 B | 0755 |
|
gauge | File | 285 B | 0755 |
|
gauge0-input-fd | File | 390 B | 0755 |
|
gauge2 | File | 468 B | 0755 |
|
infobox | File | 501 B | 0755 |
|
infobox2 | File | 500 B | 0755 |
|
infobox3 | File | 515 B | 0755 |
|
infobox4 | File | 515 B | 0755 |
|
inputbox | File | 565 B | 0755 |
|
inputbox1 | File | 562 B | 0755 |
|
inputbox2 | File | 565 B | 0755 |
|
inputbox3 | File | 586 B | 0755 |
|
inputbox4 | File | 645 B | 0755 |
|
inputbox5 | File | 640 B | 0755 |
|
inputbox6-utf8 | File | 268 B | 0755 |
|
inputbox7 | File | 768 B | 0755 |
|
inputmenu-stdout | File | 1.44 KB | 0755 |
|
inputmenu1 | File | 1.5 KB | 0755 |
|
inputmenu2 | File | 1.73 KB | 0755 |
|
inputmenu3 | File | 1.93 KB | 0755 |
|
inputmenu4 | File | 1.5 KB | 0755 |
|
menubox | File | 835 B | 0755 |
|
menubox-utf8 | File | 860 B | 0755 |
|
menubox1 | File | 857 B | 0755 |
|
menubox10 | File | 417 B | 0755 |
|
menubox2 | File | 858 B | 0755 |
|
menubox3 | File | 1.08 KB | 0755 |
|
menubox4 | File | 1.26 KB | 0755 |
|
menubox5 | File | 1.55 KB | 0755 |
|
mixedform | File | 1.23 KB | 0755 |
|
mixedform2 | File | 1.24 KB | 0755 |
|
mixedgauge | File | 580 B | 0755 |
|
msgbox | File | 352 B | 0755 |
|
msgbox1 | File | 1.54 KB | 0755 |
|
msgbox2 | File | 1.54 KB | 0755 |
|
msgbox4-eucjp | File | 805 B | 0755 |
|
msgbox4-utf8 | File | 1019 B | 0755 |
|
password | File | 570 B | 0755 |
|
password1 | File | 585 B | 0755 |
|
password2 | File | 592 B | 0755 |
|
pause | File | 181 B | 0755 |
|
radiolist | File | 1015 B | 0755 |
|
radiolist10 | File | 815 B | 0755 |
|
report-button | File | 446 B | 0644 |
|
report-edit | File | 464 B | 0644 |
|
report-string | File | 520 B | 0644 |
|
report-tempfile | File | 544 B | 0644 |
|
report-yesno | File | 433 B | 0644 |
|
setup-edit | File | 258 B | 0644 |
|
setup-tempfile | File | 214 B | 0644 |
|
setup-utf8 | File | 198 B | 0644 |
|
setup-vars | File | 545 B | 0644 |
|
textbox | File | 1.09 KB | 0755 |
|
textbox2 | File | 1.08 KB | 0755 |
|
timebox | File | 263 B | 0755 |
|
timebox-stdout | File | 212 B | 0755 |
|
timebox2 | File | 217 B | 0755 |
|
timebox2-stdout | File | 204 B | 0755 |
|
yesno | File | 758 B | 0755 |
|
yesno2 | File | 592 B | 0755 |
|
yesno3 | File | 605 B | 0755 |
|