#!/bin/sh

GTKDIALOG=gtkdialog

TMPDIR=/tmp/gtkdialog/examples/"`basename $0`"
mkdir -p "$TMPDIR"

cat <<EOF > "$TMPDIR"/list.txt
gtk-cdrom    | CD_ROM Drive  | /cdrom/    | ak.tex
gtk-floppy   | Floppy Disk   | /floppy/   | ak.dvi
gtk-harddisk | Hard Disk     | /harddisk/ | ak.ps
gtk-network  | Network Drive | /network/  | ak.pdf
gtk-delete   | Trash         | /trash/    | 
EOF

MAIN_DIALOG='
<window>
	<vbox>
		<notebook labels="Checkbox|Radiobutton|Tree">
			<vbox>
				<checkbox>
					<label>This is a checkbox</label>
				</checkbox>
				<checkbox>
					<label>Another checkbox</label>
				</checkbox>
				<checkbox>
					<label>The third checkbox</label>
				</checkbox>
			</vbox>
			<vbox>
				<radiobutton>
					<label>First radiobutton in the group</label>
				</radiobutton>
				<radiobutton>
					<label>The second radiobutton</label>
				</radiobutton>
				<radiobutton>
					<label>Third radiobutton</label>
					<default>true</default>
				</radiobutton>
			</vbox>
			<tree>
				<input file>'"$TMPDIR"'/list.txt</input>
				<label>First</label>
				<item stock="gtk-floppy">This is a floppy</item>
				<item stock="gtk-cdrom">This is a CD-ROM</item>
				<item>This line has no icon</item>
				<variable>EDITOR</variable>
			</tree>
		</notebook>
		<hbox>
			<button cancel></button>
			<button ok></button>
		</hbox>
	</vbox>
</window>
'
export MAIN_DIALOG

case $1 in
	-d | --dump) echo "$MAIN_DIALOG" ;;
	*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
