--- ray/src/util/trad.wsh 1994/11/06 11:45:08 2.7 +++ ray/src/util/trad.wsh 1995/09/20 12:56:00 2.11 @@ -1,4 +1,4 @@ -#!/usr/local/bin/wish -f +#!/usr/local/bin/wish4.0 # SCCSid "$SunId$ LBL" # # TCL/TK-based Rad Input File Editor @@ -27,18 +27,18 @@ proc modified {} { # check for radvar modification proc chksave {} { # check if RIF is saved and accost user if not global readonly rifname oldradvar curmess - if $readonly { - set warnmess "You have modified variables, but the file\ -\"[file tail $rifname]\" was opened read-only. + if [modified] { + if $readonly { + set warnmess "You have modified variables, but the\ +file \"[file tail $rifname]\" was opened read-only. Do you wish to save this information somehow?" - set yesmess {Go to File Screen} - } else { - set warnmess "The file \"[file tail $rifname]\" has been\ -modified since it was last saved. +set yesmess {Go to File Screen} + } else { + set warnmess "The file \"[file tail $rifname]\" has\ +been modified since it was last saved. Do you wish to save it now?" - set yesmess {Save File} - } - if [modified] { + set yesmess {Save File} + } switch [tk_dialog .dlg {File Modified} $warnmess \ warning 0 $yesmess {Discard Changes} \ {Cancel Operation}] { @@ -46,14 +46,16 @@ Do you wish to save it now?" 2 { return 0 } } if $readonly { - .file invoke set curmess {Rename file or uncheck read-only to save.} + .file invoke return 0 } elseif {[save_vars $rifname]} { gotfile 1 return 1 - } else { return 0 } - } else { return 1 } + } + return 0 + } + return 1 } # Set global variable default values @@ -77,12 +79,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 @@ -104,9 +106,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 } @@ -133,11 +135,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 {