Changeset 362


Ignore:
Timestamp:
Dec 4, 2009 5:04:54 PM (14 years ago)
Author:
toby
Message:

# on 2000/12/22 19:44:07, toby did:
Implement autoraise
detect expgui.lck in windows and delay while it runs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/liveplot

    • Property rcs:date changed from 2000/05/26 14:06:54 to 2000/12/22 19:44:07
    • Property rcs:lines changed from +5 -3 to +30 -12
    • Property rcs:rev changed from 1.13 to 1.14
    r153 r362  
    4040set graph(xunits) 0
    4141set graph(yunits) 0
     42set graph(autoraise) 1
    4243set expgui(debug) 0
    4344catch {if $env(DEBUG) {set expgui(debug) 1}}
     
    173174
    174175proc readdata {box} {
    175     global expgui
     176    global expgui modtime expnam
    176177    if [catch {
     178        set modtime [file mtime $expnam.EXP]
    177179        set loadtime [time {
    178180            if {$expgui(tcldump) == ""} {
     
    718720    puts $fp "set graph(outname) $graph(outname)"
    719721    puts $fp "set graph(outcmd) $graph(outcmd)"
     722    puts $fp "set graph(autoraise) $graph(autoraise)"
    720723    puts $fp "set expgui(lblfontsize) $expgui(lblfontsize)"
    721724    puts $fp "set expgui(fadetime) $expgui(fadetime)"
     
    751754
    752755proc updateifnew {} {
    753     global cycle modtime expnam
     756    global cycle modtime expnam env tcl_platform graph
     757    # has the .EXP file been changed?
    754758    if {[file mtime $expnam.EXP] != $modtime} {
    755         set modtime [file mtime $expnam.EXP]
    756         set newcycle [getcycle]
    757         if {$newcycle != $cycle} {
    758             set cycle $newcycle
    759             # delay one second
    760             # after 1000
    761             readdata .g
    762         }
    763     }
    764     # check every second
     759        # are we in windows and are "locked?" If not, OK to update
     760        if {$tcl_platform(platform) == "windows" && [file exists expgui.lck]} {
     761            .g config -title "(Experiment directory locked)"
     762        } else {
     763            set modtime [file mtime $expnam.EXP]
     764            set newcycle [getcycle]
     765            if {$newcycle != $cycle} {
     766                set cycle $newcycle
     767                readdata .g
     768            }
     769            if {$tcl_platform(platform) == "windows" && $graph(autoraise)} {
     770                # raise does not seem to be global in Windows,
     771                # but this works in Win-95
     772                # nothing seems to work in Win-NT
     773                wm withdraw .
     774                wm deiconify .
     775            } elseif {$graph(autoraise)} {
     776                raise .
     777            }
     778        }
     779    }
     780    # check again in a second
    765781    after 1000 updateifnew
    766782}
     
    938954        -command {setlegend $box $graph(legend)}
    939955.a.options.menu add command -label "Set PS output" -command setpostscriptout
     956.a.options.menu add checkbutton -label "Raise on update" \
     957        -variable graph(autoraise)
    940958.a.options.menu add command -label "Save Options" -underline 1 \
    941959        -command "SaveOptions"
Note: See TracChangeset for help on using the changeset viewer.