--- ray/src/util/trad.wsh 1994/12/05 09:50:43 2.9 +++ ray/src/util/trad.wsh 1996/05/17 13:53:09 2.14 @@ -1,4 +1,4 @@ -#!/usr/local/bin/wish -f +#!/usr/local/bin/wish4.0 # SCCSid "$SunId$ LBL" # # TCL/TK-based Rad Input File Editor @@ -11,6 +11,14 @@ set helplib $radlib set auto_path [linsert $auto_path 0 $radlib] +# Assign global globbing variables + +set myglob(rif) *.rif +set myglob(materials) *.mat +set myglob(illum) *.rad +set myglob(scene) *.rad +set myglob(objects) * + # Create required procedures proc modified {} { # check for radvar modification @@ -79,12 +87,12 @@ set smallscrn [expr [winfo screenwidth .] < 830] message .mess -relief ridge -font fixed -textvariable curmess -anchor nw if $smallscrn { - frame .upper -geometry 640x410 - frame .upper.right -geometry 120x410 + frame .upper -width 640 -height 410 + frame .upper.right -width 120 -height 410 .mess configure -width 640 } else { - frame .upper -geometry 830x410 - frame .upper.right -geometry 130x410 + frame .upper -width 830 -height 410 + frame .upper.right -width 130 -height 410 .mess configure -width 830 } pack .upper -side top @@ -106,9 +114,9 @@ proc changescreen {} { # switch screen according to c set curscreen $curmode do_$curscreen .upper.left if $smallscrn { - .upper.left configure -geometry 520x410 + .upper.left configure -width 520 -height 410 } else { - .upper.left configure -geometry 700x410 + .upper.left configure -width 700 -height 410 } place .upper.left -x 0 -y 0 } @@ -135,11 +143,11 @@ setbutt results rename setbutt {} button .upper.right.help -text HELP -width 9 \ -command "gethelp trad trad intro" -pack .upper.right.help -side top -pady 10 -anchor se +pack .upper.right.help -side top -pady 5 -anchor se helplink .upper.right.help trad trad help button .upper.right.quit -text QUIT \ -command {if [chksave] {destroy .}} -width 9 -pack .upper.right.quit -side top -pady 10 -anchor se +pack .upper.right.quit -side top -pady 5 -anchor se helplink .upper.right.quit trad trad quit if $smallscrn { @@ -151,7 +159,7 @@ if $smallscrn { } wm iconbitmap . @$radlib/trad.icon -proc gotfile {{o 1}} { # set file possession state +proc gotfile o { # set file possession state global oldradvar radvar catch {unset oldradvar} if $o { @@ -161,7 +169,6 @@ proc gotfile {{o 1}} { # set file possession state } } else { set mode disabled - .file invoke } foreach b {scene zone views options action results} { .$b configure -state $mode @@ -170,15 +177,19 @@ proc gotfile {{o 1}} { # set file possession state # Decide where to go and start +gotfile 0 if {[llength $argv] == 0} { set curmess "Choose a Radiance project file." - gotfile 0 + .file invoke } elseif {[llength $argv] == 1} { cd [file dirname $argv] set curfile [file tail $argv] - if {! [file exists $curfile]} { - newnew $curfile - .scene invoke + if {! [file isfile $curfile]} { + if [newnew $curfile] { + .scene invoke + } else { + .file invoke + } } elseif {[newload $curfile]} { if $alldone { set curmess "All renderings are finished."