#
# <20171102.1451.31>
#
# This code hooks up tkcon with a couple of user defined files
# but only if they exist.
#
# First, the tkconrc file:
#
set us [info script]
set loc [file dir $us]
if {[file exists $loc/.tkconrc]} {
  # it exists. Where should it be?
  set envHome "HOME"
  set rcfile  "tkcon.cfg"
  
  switch $::tcl_platform(platform) {
    mcaintosh  {set envHome PREF_FOLDER}
    unix       {set rcfile  .tkconrc}
  }
  if {[info exists ::env($envHome)]} {
    set home $::env($envHome)
    if {[file pathtype $home] == "volumerelative"} {
      # Convert 'C:' to 'C:/' if necessary, innocuous otherwise
      append home /
    }
    if {![file exists [set drc [file join $home $rcfile]]]} {
      # Don't have one yet, fix that...
      file copy $loc/.tkconrc $drc
    }
  }
}
# If we have other tcl files here, we source them...
# set files [glob $loc/*.tcl]
# foreach file $files {
#   if {[string match */tkcon.tcl]} {continue}
#   if {[string match */$us]} {continue}
#   source $file
# }
