Changeset 44


Ignore:
Timestamp:
Dec 4, 2009 4:59:27 PM (13 years ago)
Author:
toby
Message:

# on 1999/01/21 22:42:08, toby did:
add SaveOptions?
use localconfig & .gsas_config
move AutoAdvance? to new Options menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lstview

    • Property rcs:date changed from 1998/11/23 19:38:02 to 1999/01/21 22:42:08
    • Property rcs:lines changed from +5 -4 to +46 -7
    • Property rcs:rev changed from 1.3 to 1.4
    r7 r44  
    2929set box {}
    3030set txtvw(followcycle) 1
    31 # override options with locally defined values
    32 if [file exists ~/.lstview_config] {
    33     source ~/.lstview_config
    34 }
    3531
    3632proc waitmsg {message} {
     
    199195}
    200196
    201 
    202197proc findsetstring {win string {menu ""} {pos 0.0}} {
    203198    global txtvw
     
    294289}
    295290
     291proc SaveOptions {} {
     292    global txtvw
     293    set fp [open [file join ~ .gsas_config] a]
     294    puts $fp "set txtvw(followcycle) $txtvw(followcycle)"
     295    close $fp
     296}
     297
    296298proc aboutgsas {} {
    297299    global Revision
     
    302304$Revision\n\
    303305" {} 0 OK
     306}
     307
     308#----------------------------------------------------------------
     309# where are we?
     310set expgui(script) [info script]
     311# translate links -- go six levels deep
     312foreach i {1 2 3 4 5 6} {
     313    if {[file type $expgui(script)] == "link"} {
     314        set link [file readlink $expgui(script)]
     315        if { [file  pathtype  $link] == "absolute" } {
     316h           set expgui(script) $link
     317        } {
     318            set expgui(script) [file dirname $expgui(script)]/$link
     319        }
     320    } else {
     321        break
     322    }
     323}
     324
     325# fixup relative paths
     326if {[file pathtype $expgui(script)] == "relative"} {
     327    set expgui(script) [file join [pwd] $expgui(script)]
     328}
     329set expgui(scriptdir) [file dirname $expgui(script) ]
     330# override options with locally defined values
     331if [file exists [file join $expgui(scriptdir) localconfig]] {
     332    source [file join $expgui(scriptdir) localconfig]
     333}
     334if [file exists [file join ~ .gsas_config]] {
     335    source [file join ~ .gsas_config]
    304336}
    305337
     
    330362            -side left
    331363menu .a.goto.menu
    332 .a.goto.menu  add checkbutton -label "Auto Advance" -variable txtvw(followcycle)
    333364.a.goto.menu add cascade -label "Cycle #"  -menu .a.goto.menu.cyc \
    334365        -state disabled
     
    344375.a.goto.menu add cascade -label ""  -menu .a.goto.menu.str -state disabled
    345376menu .a.goto.menu.str
     377
     378pack [menubutton .a.options -text "Options" -underline 0 \
     379        -menu .a.options.menu] \
     380            -side left
     381menu .a.options.menu
     382.a.options.menu  add checkbutton -label "Auto Advance" -variable txtvw(followcycle)
     383.a.options.menu add command -label "Save Options" -underline 1 \
     384        -command "SaveOptions"
    346385
    347386if {$plotvars && ![catch {package require BLT}]} {
Note: See TracChangeset for help on using the changeset viewer.