#! /bin/sh # MX Tcl/Tk GUI main program written by William Lavender. # # Copyright 1999-2002, 2004, 2013 Illinois Institute of Technology # # See the file "LICENSE" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # # Look for wish in the users' PATH. \ exec wish "$0" ${1+"$@"} # # This file should _not_ have a package provide line in it. So don't # put one in. # set version [info tclversion] if { [ expr $version < 8.3 ] } { puts "Tcl versions older than 8.3 are not supported by the MX Tcl GUI." puts "You have Tcl version $version" puts "Exiting..." exit } # # If the MXDIR environment variable is not defined, set it to the # default value. # if { [ info exists env(MXDIR) ] == 0 } { set env(MXDIR) [ file join "/" "opt" "mx" ] } # # If the MXTEST environment variable is defined, we will look for the MxTcl # package in ../libMxTcl. Otherwise, we look for it in $MXDIR/lib/mxtcl. # set test 0 if [ info exists env(MXTEST) ] { if { $env(MXTEST) != 0 } { set test 1 } } if { $test } { puts "MX Gui is in test mode." set mxtcl_package_dir_list [ concat \ [ file join "." ] \ [ file join ".." "libMxTcl" ] \ [ file join ".." "mxgui" ] ] } else { set mxtcl_package_dir_list [ concat \ [ file join $env(MXDIR) "lib" "mxgui" ] \ [ file join $env(MXDIR) "lib" "mxtcl" ] ] } set auto_path [ concat $mxtcl_package_dir_list $auto_path ] # Load the necessary [incr Tcl] Packages. package require Itcl 3.1 package require Itk 3.1 if [ catch { package require Iwidgets 4.0 } ] { package require Iwidgets 3.0 } # Load the necessary MX packages. package require Mx package require MxGui # Specify the list of MX database files. if [ info exists env(HOME) ] { set tcl_savefile_dir $env(HOME) } else { set tcl_savefile_dir "." } set argv [ concat [ file join $env(MXDIR) "etc" "mxmotor.dat" ] \ [ file join $env(MXDIR) "etc" "mxscan.dat" ] \ [ file join $tcl_savefile_dir "mxscan.dat" ] ] # Create the mxgui windows. setup_mxgui $argv0 $argv