Changeset 944 for trunk/expgui


Ignore:
Timestamp:
Mar 8, 2010 11:59:02 PM (11 years ago)
Author:
toby
Message:

fix positioning, remove localconfig

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    r935 r944  
    305305    catch {set ypos $expgui(ypos)}
    306306    set poscntr "nsew"
    307     catch {set posnctr $expgui(poscenter)}
     307    catch {set poscntr $expgui(poscenter)}
    308308    LocateWindow "." $xpos $ypos $poscntr
    309309    # windows needed this update before when using tk_getOpenFile.
     
    659659        puts $fp "set peakinfo($v) [list $peakinfo($v)]"
    660660    }
     661    close $fp
     662}
     663
     664# save some of the global options in ~/.gsas_config or ~/gsas.config in Windows
     665proc 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"
    661677    close $fp
    662678}
     
    42564272$expgui(fm).option.menu add command -label "Save Options" \
    42574273        -command "SaveOptions"
     4274$expgui(fm).option.menu add command -label "Save Position" \
     4275        -command "SavePosition"
    42584276pack $expgui(fm).file $expgui(fm).option -side left  -in $expgui(fm)
    42594277
     
    44154433catch {set ypos $expgui(ypos)}
    44164434set poscntr "nsew"
    4417 catch {set posnctr $expgui(poscenter)}
     4435catch {set poscntr $expgui(poscenter)}
    44184436LocateWindow "." $xpos $ypos $poscntr
    44194437update
Note: See TracChangeset for help on using the changeset viewer.