Changeset 746 for trunk/expgui
- Timestamp:
- Dec 4, 2009 5:11:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2003/08/11 18:14:54 to 2003/11/13 17:16:28
- Property rcs:lines changed from +18 -3 to +37 -30
- Property rcs:rev changed from 1.62 to 1.63
r720 r746 193 193 } else { 194 194 set expgui(exptool) [file join $expgui(gsasexe) exptool] 195 if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1} 195 if {$tcl_platform(os) != "Darwin"} { 196 if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1} 197 } 196 198 } 197 199 # do we have a PGPLOT fonts file? … … 249 251 } 250 252 } 253 set expgui(resize) 0 251 254 if {$expgui(expfile) == ""} { 252 255 # center the parent window because the getExpFileName window … … 261 264 update 262 265 # 263 set expgui(expfile) [getExpFileName old] 266 set expgui(expfile) [getExpFileName ""] 267 set expgui(resize) 1 264 268 } 265 269 if {$expgui(expfile) == ""} exit … … 314 318 close $fp 315 319 } 316 } 317 file copy -force $expfile $expnam.EXP 318 set fmt [expload $expfile] 319 # if the file was not in the correct format, force a rewrite before use 320 if {$fmt < 0} { 321 # read error 322 return 323 } elseif {$fmt == 1} { 324 set expgui(changed) 0 325 } else { 326 set expgui(changed) 1 327 } 328 set expfile $expnam.EXP 320 file copy -force $expfile $expnam.EXP 321 set expfile $expnam.EXP 322 } 329 323 if {$ans == "use new name"} { 330 SaveAsFile 331 set expfile $expgui(expfile) 332 } 324 set newexpfile [getExpFileName new] 325 if {$newexpfile == ""} return 326 file copy -force $expfile $newexpfile 327 catch {cd [string trim [file dirname $expgui(expfile)]]} 328 set expfile [file tail $newexpfile] 329 } 330 } 331 set expgui(expfile) $expfile 332 set fmt [expload $expfile] 333 # if the file was not in the correct format, force a rewrite before use 334 if {$fmt < 0} { 335 # read error 336 return 337 } elseif {$fmt == 1} { 338 set expgui(changed) 0 333 339 } else { 334 set exploadtime [time {set fmt [expload $expfile]}] 335 if $expgui(debug) {puts "expload $exploadtime"} 336 # if the file was not in the correct format, force a rewrite before use 337 if {$fmt < 0} { 338 # read error 339 return 340 } elseif {$fmt == 1} { 341 set expgui(changed) 0 342 } else { 343 set expgui(changed) 1 344 } 340 set expgui(changed) 1 345 341 } 346 342 # force exp files to be upper case, force save if name changes … … 764 760 } 765 761 # Create a binding for <Return> on the dialog 766 bind $w <Return> " tkButtonInvoke $w.bot.1"762 bind $w <Return> "$w.bot.1 invoke" 767 763 wm withdraw $w 768 764 update idletasks … … 4260 4256 # resize the notebook to fit all the tabs and the largest page 4261 4257 ResizeNotebook 4258 if {$expgui(resize)} { 4259 # this appears to be needed by OSX 4260 update 4261 wm geom . [winfo reqwidth .]x[winfo reqheight .] 4262 # center the EXPGUI window 4263 wm withdraw . 4264 set x [expr [winfo screenwidth .]/2 - [winfo reqwidth .]/2 ] 4265 set y [expr [winfo screenheight .]/2 - [winfo reqheight .]/2] 4266 wm geom . +$x+$y 4267 wm deiconify . 4268 } 4262 4269 4263 4270 RaisePage lsFrame
Note: See TracChangeset
for help on using the changeset viewer.