| 1 |
< |
#!/usr/local/bin/wish -f |
| 1 |
> |
#!/usr/local/bin/wish4.0 |
| 2 |
|
# SCCSid "$SunId$ LBL" |
| 3 |
|
# |
| 4 |
|
# TCL/TK-based Rad Input File Editor |
| 135 |
|
rename setbutt {} |
| 136 |
|
button .upper.right.help -text HELP -width 9 \ |
| 137 |
|
-command "gethelp trad trad intro" |
| 138 |
< |
pack .upper.right.help -side top -pady 10 -anchor se |
| 138 |
> |
pack .upper.right.help -side top -pady 5 -anchor se |
| 139 |
|
helplink .upper.right.help trad trad help |
| 140 |
|
button .upper.right.quit -text QUIT \ |
| 141 |
|
-command {if [chksave] {destroy .}} -width 9 |
| 142 |
< |
pack .upper.right.quit -side top -pady 10 -anchor se |
| 142 |
> |
pack .upper.right.quit -side top -pady 5 -anchor se |
| 143 |
|
helplink .upper.right.quit trad trad quit |
| 144 |
|
|
| 145 |
|
if $smallscrn { |
| 151 |
|
} |
| 152 |
|
wm iconbitmap . @$radlib/trad.icon |
| 153 |
|
|
| 154 |
< |
proc gotfile {{o 1}} { # set file possession state |
| 154 |
> |
proc gotfile o { # set file possession state |
| 155 |
|
global oldradvar radvar |
| 156 |
|
catch {unset oldradvar} |
| 157 |
|
if $o { |
| 161 |
|
} |
| 162 |
|
} else { |
| 163 |
|
set mode disabled |
| 164 |
– |
.file invoke |
| 164 |
|
} |
| 165 |
|
foreach b {scene zone views options action results} { |
| 166 |
|
.$b configure -state $mode |
| 169 |
|
|
| 170 |
|
# Decide where to go and start |
| 171 |
|
|
| 172 |
+ |
gotfile 0 |
| 173 |
|
if {[llength $argv] == 0} { |
| 174 |
|
set curmess "Choose a Radiance project file." |
| 175 |
< |
gotfile 0 |
| 175 |
> |
.file invoke |
| 176 |
|
} elseif {[llength $argv] == 1} { |
| 177 |
|
cd [file dirname $argv] |
| 178 |
|
set curfile [file tail $argv] |
| 179 |
< |
if {! [file exists $curfile]} { |
| 180 |
< |
newnew $curfile |
| 181 |
< |
.scene invoke |
| 179 |
> |
if {! [file isfile $curfile]} { |
| 180 |
> |
if [newnew $curfile] { |
| 181 |
> |
.scene invoke |
| 182 |
> |
} else { |
| 183 |
> |
.file invoke |
| 184 |
> |
} |
| 185 |
|
} elseif {[newload $curfile]} { |
| 186 |
|
if $alldone { |
| 187 |
|
set curmess "All renderings are finished." |