Changeset 944 for trunk/expgui
- Timestamp:
- Mar 8, 2010 11:59:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
r935 r944 305 305 catch {set ypos $expgui(ypos)} 306 306 set poscntr "nsew" 307 catch {set pos nctr $expgui(poscenter)}307 catch {set poscntr $expgui(poscenter)} 308 308 LocateWindow "." $xpos $ypos $poscntr 309 309 # windows needed this update before when using tk_getOpenFile. … … 659 659 puts $fp "set peakinfo($v) [list $peakinfo($v)]" 660 660 } 661 close $fp 662 } 663 664 # save some of the global options in ~/.gsas_config or ~/gsas.config in Windows 665 proc SavePosition {} { 666 global expgui env tcl_platform graph peakinfo 667 if {$tcl_platform(platform) == "windows"} { 668 set fp [open c:/gsas.config a] 669 } else { 670 set fp [open [file join ~ .gsas_config] a] 671 } 672 673 puts $fp "# EXPGUI saved screen position on [clock format [clock seconds]]" 674 puts $fp "set expgui(xpos) [expr {[winfo x .]*100./[winfo screenwidth .]}]" 675 puts $fp "set expgui(ypos) [expr {[winfo y .]*100./[winfo screenheight .]}]" 676 puts $fp "set expgui(poscenter) NW" 661 677 close $fp 662 678 } … … 4256 4272 $expgui(fm).option.menu add command -label "Save Options" \ 4257 4273 -command "SaveOptions" 4274 $expgui(fm).option.menu add command -label "Save Position" \ 4275 -command "SavePosition" 4258 4276 pack $expgui(fm).file $expgui(fm).option -side left -in $expgui(fm) 4259 4277 … … 4415 4433 catch {set ypos $expgui(ypos)} 4416 4434 set poscntr "nsew" 4417 catch {set pos nctr $expgui(poscenter)}4435 catch {set poscntr $expgui(poscenter)} 4418 4436 LocateWindow "." $xpos $ypos $poscntr 4419 4437 update
Note: See TracChangeset
for help on using the changeset viewer.