#!/bin/sh CHOICE=`Xdialog --stdout --title "TREE VIEW BOX" \ --treeview "treeview box demo" 0 0 0 \ tag1 one off 0 \ tag2 two off 1 \ tag3 three on 2 \ tag4 four off 1 \ tag5 five off 2 \ tag6 six off 3 \ tag7 seven off 3 \ tag8 eight off 4 \ tag9 nine off 1` case $? in 0) echo "$CHOICE";; 1) echo "Cancel pressed.";; 255) echo "Box closed.";; esac