xref: /freebsd/contrib/dialog/samples/checklist6 (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1#! /bin/sh
2# $Id: checklist6,v 1.11 2010/01/13 10:20:03 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
28retval=$?
29
30. ./report-tempfile
31