home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / text / latex / mac / alpha60.hqx / Tcl / SystemCode / paths.tcl < prev    next >
Encoding:
Text File  |  1995-07-15  |  2.0 KB  |  66 lines

  1.  
  2. # Any directory must have 'folder' somewhere in the comment.
  3. set pathComments(texPath)        "TeX application"
  4. set pathComments(TeXInputs)        "TeX Inputs folder"
  5. set pathComments(bibtexPath)    "BibTeX"
  6. set pathComments(cdPath)        "CodeWarrior Debugger"
  7. set pathSig(cdPath)                "cwdSig"
  8. set pathComments(cwPath)        "CodeWarrior Compiler"
  9. set pathSig(cwPath)                "cwSig"
  10. set pathComments(excaliburPath)    "Excalibur Spellchecker"
  11. set pathComments(macperlPath)    "MacPerl"
  12. set pathComments(perlFilterPath)     "MacPerl Text Filters folder"
  13. set pathComments(perlLib)         "MacPerl lib folder"
  14. set pathComments(referencePath)    "Think Reference"
  15. set pathComments(tassPath)        "Toolbox Assistant"
  16. set pathComments(kodexPath)        "Kodex C Pretty Printer"
  17. set pathComments(enscriptorPath) "Enscriptor Fancy Printer"
  18. set pathComments(droppsPath)    "DropĂ‘PS"
  19. set pathComments(symPath)        "Symantec Project Manager"
  20. set pathComments(symDbgPath)    "Symantec Debugger"
  21.  
  22.  
  23.  
  24. set tmp {}
  25. foreach n [array names pathComments] {
  26.     lappend tmp $pathComments($n)
  27. }
  28. menu -n appPaths -m -p pathProc [lsort $tmp]
  29. unset tmp
  30.  
  31.  
  32. #===============================================================================
  33.  
  34. proc pathProc {menu comment} {
  35.     global pathComments modifiedVars pathSig
  36.  
  37.     foreach path [array names pathComments] {
  38.         if {$pathComments($path) == $comment} {
  39.             global $path                
  40.             if {[info exists $path]} {
  41.                 set res [buttonAlert "$pathComments($path):\r[set $path]" OK Change Remove]
  42.             } else {
  43.                 set res [buttonAlert "'$path' not set:" OK Set Remove]
  44.             }
  45.             switch $res {
  46.                 "Set"        "-"
  47.                 "Change"     {     if {[regexp -nocase {.*folder.*} $pathComments($path)]} {
  48.                                     set $path [get_directory -p "Select $pathComments($path):"]
  49.                                 } else {
  50.                                     set $path [getfile "Select $pathComments($path):"]
  51.                                 }
  52.                 
  53.                                 lappend modifiedVars $path
  54.                                 if {[info exists pathSig($path)]} {
  55.                                 global $pathSig($path)
  56.                                 set $pathSig($path) [getFileSig [set $path]]
  57.                                 lappend modifiedVars $pathSig($path)
  58.                             }
  59.                 }
  60.                 "Remove"    { set $path {} }
  61.             }
  62.             return
  63.         }
  64.     }
  65. }
  66.