#!/bin/csh -f

setenv USE_TCL_833 1

if ( -e "$ICEM_ACN/bin/wish8.4.11" ) then
    setenv TK_LIBRARY "$ICEM_ACN/lib/tk8.4.11"
    setenv TCL_LIBRARY "$ICEM_ACN/lib/tcl8.4.11"
    echo "Using tk8.4.11 / tcl8.4.11"
    set bltwish = wish8.4.11
else

    if ( -e $ICEM_ACN/bin/wish8.3.3 && $?USE_TCL_833 ) then

        setenv TK_LIBRARY $ICEM_ACN/lib/tk8.3.3
        setenv TCL_LIBRARY $ICEM_ACN/lib/tcl8.3.3
        echo "Using tk8.3.3 / tcl8.3.3" 
        set bltwish = wish8.3.3

    else
    
        setenv TK_LIBRARY $ICEM_ACN/lib/tk8.0
        setenv TCL_LIBRARY $ICEM_ACN/lib/tcl8.0
        setenv BLT_LIBRARY $ICEM_ACN/lib/blt2.4
        echo "Using tk8.0 / tcl8.0" 
        set bltwish = bltwish

    endif
endif

set guibase = $ICEM_ACN/lib/tetra/guibase/guibase.tcl
set toolprog = $ICEM_ACN/lib/tetra/tetra.tcl
if $?GUIBASE_DIR then
	set guibase = $GUIBASE_DIR/guibase.tcl
endif
if $?TETRA_DIR then
	set toolprog = $TETRA_DIR/tetra.tcl
endif

$ICEM_ACN/bin/$bltwish -f $guibase -tool $toolprog $*
