# $Header: /home/cvsroot/tcldb/ucodb/Tlib/printBox,v 1.3 1999/06/24 00:59:42 de Exp $
#
proc printBox box {

# box is the name of any listbox

	global exedir

	set len [$box size]
	set uniq [clock seconds]
	set file "/tmp/Box$uniq"

	set output ""
	loop i 0 $len {

		append output "[string trimright [string trimleft [$box get $i] \{ ] \} ]\n"

	}

	write_file $file "$output"
	puts stderr "Wrote box contents to $file"

	if [file exists $exedir/anyprint] {
  		exec $exedir/anyprint << $output
	} else {
		exec lpr << $output
		
	}


}
