1#!/bin/sh
2#-
3# SPDX-License-Identifier: CC0-1.0
4#
5# Written in 2021 by Alfonso Sabato Siciliano.
6#
7# To the extent possible under law, the author has dedicated all copyright
8# and related and neighboring rights to this software to the public domain
9# worldwide. This software is distributed without any warranty, see:
10#	<http://creativecommons.org/publicdomain/zero/1.0/>.
11
12: ${BSDDIALOG_ERROR=255}
13: ${BSDDIALOG_OK=0}
14: ${BSDDIALOG_CANCEL=1}
15: ${BSDDIALOG_ESC=5}
16
17FORMS=$(./bsddialog --insecure --title " mixedform " \
18	--mixedform "Hello World!" 12 40 3 \
19	Label:    1 1  Entry      1  11  18  25  0 \
20	Label:    2 1  Read-Only  2  11  18  25  2 \
21	Password: 3 1  ""         3  11  18  25  1 \
223>&1 1>&2 2>&3 3>&-)
23
24case $? in
25	$BSDDIALOG_ERROR )
26		exit 1
27	;;
28	$BSDDIALOG_ESC )
29		echo "[ESC]"
30	;;
31	$BSDDIALOG_CANCEL )
32		echo "[Cancel]"
33	;;
34	$BSDDIALOG_OK )
35		echo "[OK]"
36	;;
37esac
38
39echo "$FORMS"
40