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 |
11 |
|
|
12 |
|
set auto_path [linsert $auto_path 0 $radlib] |
13 |
|
|
14 |
+ |
# Assign global globbing variables |
15 |
+ |
|
16 |
+ |
set myglob(rif) *.rif |
17 |
+ |
set myglob(materials) *.mat |
18 |
+ |
set myglob(illum) *.rad |
19 |
+ |
set myglob(scene) *.rad |
20 |
+ |
set myglob(objects) * |
21 |
+ |
|
22 |
|
# Create required procedures |
23 |
|
|
24 |
|
proc modified {} { # check for radvar modification |
143 |
|
rename setbutt {} |
144 |
|
button .upper.right.help -text HELP -width 9 \ |
145 |
|
-command "gethelp trad trad intro" |
146 |
< |
pack .upper.right.help -side top -pady 10 -anchor se |
146 |
> |
pack .upper.right.help -side top -pady 5 -anchor se |
147 |
|
helplink .upper.right.help trad trad help |
148 |
|
button .upper.right.quit -text QUIT \ |
149 |
|
-command {if [chksave] {destroy .}} -width 9 |
150 |
< |
pack .upper.right.quit -side top -pady 10 -anchor se |
150 |
> |
pack .upper.right.quit -side top -pady 5 -anchor se |
151 |
|
helplink .upper.right.quit trad trad quit |
152 |
|
|
153 |
|
if $smallscrn { |
159 |
|
} |
160 |
|
wm iconbitmap . @$radlib/trad.icon |
161 |
|
|
162 |
< |
proc gotfile {{o 1}} { # set file possession state |
162 |
> |
proc gotfile o { # set file possession state |
163 |
|
global oldradvar radvar |
164 |
|
catch {unset oldradvar} |
165 |
|
if $o { |
169 |
|
} |
170 |
|
} else { |
171 |
|
set mode disabled |
164 |
– |
.file invoke |
172 |
|
} |
173 |
|
foreach b {scene zone views options action results} { |
174 |
|
.$b configure -state $mode |
177 |
|
|
178 |
|
# Decide where to go and start |
179 |
|
|
180 |
+ |
gotfile 0 |
181 |
|
if {[llength $argv] == 0} { |
182 |
|
set curmess "Choose a Radiance project file." |
183 |
< |
gotfile 0 |
183 |
> |
.file invoke |
184 |
|
} elseif {[llength $argv] == 1} { |
185 |
|
cd [file dirname $argv] |
186 |
|
set curfile [file tail $argv] |
187 |
< |
if {! [file exists $curfile]} { |
188 |
< |
newnew $curfile |
189 |
< |
.scene invoke |
187 |
> |
if {! [file isfile $curfile]} { |
188 |
> |
if [newnew $curfile] { |
189 |
> |
.scene invoke |
190 |
> |
} else { |
191 |
> |
.file invoke |
192 |
> |
} |
193 |
|
} elseif {[newload $curfile]} { |
194 |
|
if $alldone { |
195 |
|
set curmess "All renderings are finished." |