xref: /freebsd/contrib/dialog/samples/treeview2 (revision 3c4ba5f55438f7afd4f4b0b56f88f2bb505fd6a6)
1#!/bin/sh
2# $Id: treeview2,v 1.5 2020/11/26 00:05:52 tom Exp $
3
4. ./setup-vars
5
6. ./setup-edit
7
8case "x$DIALOGOPTS" in
9*--no-items*|*--noitem*)
10	CUT="cut -d: -f1,3,4"
11	;;
12*)
13	CUT="cat"
14	;;
15esac
16
17$CUT >$input <<-EOF
18	tag1:one:off:0
19	tag2:two:off:1
20	tag3:three:on:2
21	tag4:four:off:1
22	tag5:five:off:2
23	tag6:six:off:3
24	tag7:seven:off:3
25	tag8:eight:off:4
26	tag11:1one:off:0
27	tag12:1two:off:1
28	tag13:1three:on:2
29	tag14:1four:off:1
30	tag15:1five:off:2
31	tag16:1six:off:3
32	tag17:1seven:off:3
33	tag18:1eight:off:4
34	tag21:2one:off:0
35	tag22:2two:off:1
36	tag23:2three:on:2
37	tag24:2four:off:1
38	tag25:2five:off:2
39	tag26:2six:off:3
40	tag27:2seven:off:3
41	tag28:2eight:off:4
42	tag9:nine:off:1
43EOF
44
45$DIALOG --title "TREE VIEW DIALOG" \
46	--scrollbar \
47	--treeview "TreeView demo" 0 0 10 `sed -e 's/:/ /g' "$input"` 2> $output
48
49returncode=$?
50
51tempfile=$output
52. ./report-tempfile
53