xref: /freebsd/contrib/dialog/samples/checklist6 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1#! /bin/sh
2# $Id: checklist6,v 1.12 2020/11/26 00:03:58 tom Exp $
3# example showing the --colors option
4
5. ./setup-vars
6
7. ./setup-tempfile
8
9$DIALOG --help-button --item-help --colors --backtitle "\Z1No Such\Zn Organization" \
10	--title "CHECKLIST BOX" "$@" \
11        --checklist "Hi, this is a checklist box. You can use this to \n\
12present a list of choices which can be turned on or \n\
13off. If there are more items than can fit on the \n\
14screen, the list will be scrolled. You can use the \n\
15\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
16hot key, or the number keys 1-9 to choose an option. \n\
17Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
18  Which of the following are fruits?" 20 61 5 \
19        "Apple"      "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                          off "fruit" \
20        "Dog"        "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                  ON  "not a fruit" \
21        "Orange"     "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                     off "fruit" \
22        "Chicken"    "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                     off "not a fruit" \
23        ""           "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                            off "not anything" \
24        "Cat"        "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN  "not a fruit" \
25        "Fish"       "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                         On  "not a fruit" \
26        "Lemon"      "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                 on  "the only one you wouldn't eat" 2> $tempfile
27
28returncode=$?
29
30. ./report-tempfile
31