home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
vwinterfac.tcl
< prev
next >
Wrap
Text File
|
1997-06-19
|
3KB
|
116 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)vwinterfac.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)vwinterfac.tcl /main/titanic/3 19 Jun 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require stgentor.tcl
require platform.tcl
# End user added include file section
require "stinterfac.tcl"
Class VWInterface : {STInterface} {
constructor
method destructor
method startST
}
constructor VWInterface {class this name} {
set this [STInterface::constructor $class $this $name]
# Start constructor user section
$this fileHandler [STFileHandler new]
$this generator [STGenerator new]
# End constructor user section
return $this
}
method VWInterface::destructor {this} {
# Start destructor user section
# End destructor user section
$this STInterface::destructor
}
# Starts Visualworks. Tries to locate the VisualWorks
# installation directory by scanning the PATH. If that is found
# tries to locate the image by reading VWIMAGEPATH.
# If it is not set the standard image is used.
# File name handling is Unix specific.
#
method VWInterface::startST {this} {
if [catch { set envPath $env(PATH) }] {
wmtkerror "environment variable PATH not found"
return
}
set visualPath ""
# visualKey is used to recognize the VW installation in the PATH
set visualKey "visual"
if $win95 {
set pathSep "\\"
set envPathSep ";"
set visualExecName "vw.exe"
} else {
set pathSep "/"
set envPathSep ":"
set visualExecName "visualworks"
}
foreach pathSpec [split $envPath $envPathSep] {
set dirList [split $pathSpec $pathSep]
set index [lsearch -exact $dirList $visualKey]
if { $index == -1 } {
set index [lsearch -exact $dirList [string toupper $visualKey]]
}
if { $index != -1 } {
# found it! find root: directories up to and including key
set visualPath [join [lrange $dirList 0 $index] $pathSep]
}
}
if { $visualPath == "" } {
wmtkerror "VisualWorks not found in PATH"
return
}
set visualExec [path_name concat [path_name concat $visualPath bin] \
$visualExecName]
if { ![file exists $visualExec] } {
wmtkerror "VisualWorks executable not found"
return
}
if [catch { set imagePath $env(VWIMAGEPATH) }] {
wmtkwarning "VWIMAGEPATH not set, using standard image"
set imagePath [path_name concat $visualPath image]
}
if { ![file exists $imagePath] } {
wmtkerror "Image path not found"
return
}
set imageFile [path_name concat $imagePath visual im]
if { ![file exists $imageFile] } {
wmtkerror "Image file not found"
return
}
# All set, do it
system "$visualExec $imageFile &"
}
# Do not delete this line -- regeneration end marker
VWInterface new .main.vw