source: trunk/liveplot @ 73

Last change on this file since 73 was 73, checked in by toby, 11 years ago

# on 1999/03/19 17:07:59, toby did:
major reworking -- implement tcldump, and new display options, hkl labels

  • Property rcs:author set to toby
  • Property rcs:date set to 1999/03/19 17:07:59
  • Property rcs:lines set to +178 -23
  • Property rcs:rev set to 1.5
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 20.1 KB
Line 
1#!/usr/local/bin/wish
2set Revision {$Revision: 73 $ $Date: 2009-12-04 22:59:57 +0000 (Fri, 04 Dec 2009) $}
3
4bind all <Control-KeyPress-c> {destroy .}
5# process command line arguments
6set exitstat 0
7set expnam [lindex $argv 0]
8if {$expnam == ""} {puts "error -- no experiment name"; set exitstat 1}
9if $exitstat {
10    puts "usage: $argv0 expnam \[hist #\] \[legend\]"
11    destroy .
12}
13if {[lindex $argv 1] == ""} {
14    set hst 1
15} else {
16    set hst [lindex $argv 1]
17}
18if {[lindex $argv 2] == ""} {
19    set graph(legend) 1
20} else {
21    set graph(legend) [lindex $argv 2]
22}
23
24
25if {$tcl_platform(platform) == "windows"} {
26    set graph(printout) 1
27    set expgui(tcldump) tcldump.exe
28} else {
29    set graph(printout) 0
30    set expgui(tcldump) tcldump
31}
32
33# default values
34set graph(outname) out.ps
35set graph(outcmd) lpr
36set xunits {}
37set yunits {}
38set graph(xunits) 0
39set graph(yunits) 0
40set expgui(debug) 0
41catch {if $env(DEBUG) {set expgui(debug) 1}}
42#set expgui(debug) 1
43
44if [catch {package require BLT} errmsg] {
45    tk_dialog .err "BLT Error" "Error -- Unable to load the BLT package" \
46            error 0 Quit
47    destroy .
48}
49# handle Tcl/Tk v8+ where BLT is in a namespace
50#  use the command so that it is loaded
51catch {blt::graph}
52catch {
53    namespace import blt::graph
54    namespace import blt::vector
55}
56# old versions of blt don't report a version number
57if [catch {set blt_version}] {set blt_version 0}
58# option for coloring markers: note that GH keeps changing how to do this!
59if {$blt_version < 2.3 || $blt_version >= 8.0} {
60    set graph(MarkerColorOpt) -fg
61} elseif {$blt_version >= 2.4} {
62    set graph(MarkerColorOpt) -outline
63} else {
64    set graph(MarkerColorOpt) -color
65}
66
67proc waitmsg {message} {
68    set w .wait
69    # kill any window/frame with this name
70    catch {destroy $w}
71    pack [frame $w]
72    frame $w.bot -relief raised -bd 1
73    pack $w.bot -side bottom -fill both
74    frame $w.top -relief raised -bd 1
75    pack $w.top -side top -fill both -expand 1
76    label $w.msg -justify left -text $message -wrap 3i
77    catch {$w.msg configure -font \
78                -Adobe-Times-Medium-R-Normal--*-180-*-*-*-*-*-*
79    }
80    pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m
81    label $w.bitmap -bitmap info
82    pack $w.bitmap -in $w.top -side left -padx 3m -pady 3m
83    update
84}
85
86proc donewait {} {
87    catch {destroy .wait}
88    update
89}
90
91waitmsg "Loading histogram, Please wait"
92
93#--------------------------------------------------------------
94# define constants
95array set peakinfo {
96    color1 magenta
97    color2 cyan
98    color3 yellow
99    color4 sienna
100    color5 orange
101    color6 DarkViolet
102    color7 HotPink
103    color8 salmon
104    color9 LimeGreen
105}
106set cycle -1
107set modtime 0
108
109#----------------------------------------------------------------
110# where are we?
111set expgui(script) [info script]
112# translate links -- go six levels deep
113foreach i {1 2 3 4 5 6} {
114    if {[file type $expgui(script)] == "link"} {
115        set link [file readlink $expgui(script)]
116        if { [file  pathtype  $link] == "absolute" } {
117            set expgui(script) $link
118        } {
119            set expgui(script) [file dirname $expgui(script)]/$link
120        }
121    } else {
122        break
123    }
124}
125
126# fixup relative paths
127if {[file pathtype $expgui(script)] == "relative"} {
128    set expgui(script) [file join [pwd] $expgui(script)]
129}
130set expgui(scriptdir) [file dirname $expgui(script) ]
131set expgui(gsasdir) [file dirname $expgui(scriptdir)]
132set expgui(gsasexe) [file join $expgui(gsasdir) exe]
133
134proc readdata {box} {
135    global expgui
136    if [catch {
137        #puts [time {
138            if {$expgui(tcldump) == ""} {
139                readdata_hst $box
140            } else {
141                readdata_tcl $box
142            }
143        #}]
144    } errmsg] {
145        if $expgui(debug) {error $errmsg}
146        $box config -title "Read error: $errmsg"
147        catch {console show}
148        puts "error message: $errmsg"
149        update
150    }
151}
152   
153proc readdata_hst {box} {
154    global expgui expnam reflns
155    global lasthst
156    global hst peakinfo xunits
157    $box config -title "(Histogram update in progress)"
158    update
159    # parse the output of a file
160        set lasthst $hst
161###########################################################################
162#       set input [open histdump.inp w]
163#       puts $input "$hst"
164#       close $input
165#       set input [open "| $expgui(gsasexe)/hstdump $expnam  < histdump.inp" w+]
166###########################################################################
167        # use histdump for right now
168        set input [open histdump$hst.inp w]
169        puts $input "$expnam"
170        puts $input "L"
171        puts $input "$hst"
172        puts $input "0"
173        close $input
174        # use hstdmp without an experiment name so that output
175        # is not sent to the .LST file
176        set input [open "| $expgui(gsasexe)/hstdmp < histdump$hst.inp" r]
177       
178        # initalize arrays
179        set num -1
180        set xlist {}
181        set obslist {}
182        set calclist {}
183        set bcklist {}
184        set xunits {}
185        # define a list of reflection positions for each phase
186        for {set i 1} {$i < 10} {incr i} {
187            set reflns($i) {}
188        }
189        set i 0
190        while {[gets $input line] >= 0} {
191            incr i
192            # run update every 50th line
193            if {$i > 50} {set i 0; update}
194            if [scan $line %d num] {
195                if {$num > 0} {
196                    set Ispec 0
197                    set X -999
198                    scan [string range $line 8 end] %e%e%e%e%e%e \
199                            X Iobs Icalc Ispec fixB fitB
200                    #puts $line
201                    # eliminate excluded points
202                    if {$Ispec > 0.0 && $X >= 0} {
203                        lappend xlist $X
204                        lappend obslist $Iobs
205                        lappend calclist $Icalc
206                        lappend bcklist [expr $fixB + $fitB]
207                    }
208                    # add peaks to peak lists
209                    #    puts "[string range $line 6 6]"
210                    # is this 6 or 7; 6 on win & 7 on SGI
211                    if [regexp {[1-9]} [string range $line 6 7] ph] {
212                        lappend reflns($ph) $X
213                    }
214                }
215            } else {
216                regexp {Time|Theta|keV} $line xunits
217            }
218        }
219        if {$xunits == "Theta"} {set xunits "2-Theta"}
220        close $input
221        catch {file delete histdump$hst.inp}
222        xvec set $xlist
223        obsvec set $obslist
224        calcvec set $calclist
225        bckvec set $bcklist
226        diffvec set [obsvec - calcvec]
227        global obsvec calcvec diffvec
228        set maxdiff  [set diffvec(max)]
229        set ymin1 [expr [set calcvec(min)] - 1.1*$maxdiff]
230        set ymin2 [expr [set obsvec(min)] - 1.1*$maxdiff]
231        if {$ymin1 < $ymin2} {
232            diffvec set [diffvec + $ymin1]
233        } {
234            diffvec set [diffvec + $ymin2]
235        }
236        plotdata $box
237}
238
239proc readdata_tcl {box} {
240    global expgui expnam reflns
241    global lasthst graph
242    global hst peakinfo xunits yunits
243    $box config -title "(Histogram update in progress)"
244    update
245    # parse the output of a file
246    set lasthst $hst
247    # use tcldump
248    set input [open histdump$hst.inp w]
249    puts $input "$hst"
250    # x units -- native
251    puts $input "$graph(xunits)"
252    # y units  -- native
253    puts $input "$graph(yunits)"
254    # format (if implemented someday)
255    puts $input "0"
256    close $input
257    # initalize arrays
258    set X {}
259    set OBS {}
260    set CALC {}
261    set BKG {}
262    set refpos {}
263    global refhkllist refphaselist
264    set refhkllist {}
265    set refphaselist {}
266    for {set i 1} {$i < 10} {incr i} {
267        set reflns($i) {}
268    }
269    eval [exec $expgui(tcldump) $expnam < histdump$hst.inp]
270    catch {file delete histdump$hst.inp}
271    if {$X == ""} {
272        $box config -title "(Error reading Histogram $hst)"
273        foreach elem [$box element show] {
274           $box element config $elem -hide 1
275        }
276        return
277    }
278    foreach elem [$box element names] {
279        $box element config $elem -hide 0
280    }
281    xvec set $X
282    obsvec set $OBS
283    calcvec set $CALC
284    bckvec set $BKG
285    refposvec set $refpos
286    diffvec set [obsvec - calcvec]
287    global obsvec calcvec diffvec
288    set maxdiff  [set diffvec(max)]
289    set ymin1 [expr [set calcvec(min)] - 1.1*$maxdiff]
290    set ymin2 [expr [set obsvec(min)] - 1.1*$maxdiff]
291    if {$ymin1 < $ymin2} {
292        diffvec set [diffvec + $ymin1]
293    } {
294        diffvec set [diffvec + $ymin2]
295    }
296    plotdata $box
297}
298
299proc lblhkl {plot x} {
300    global cellparm command blt_version refhkllist refphaselist peakinfo
301    # look for peaks within pixelregion pixels
302    set pixelregion 5
303    set xmin [$plot xaxis invtransform [expr $x - $pixelregion]]
304    set xmax [$plot xaxis invtransform [expr $x + $pixelregion]]
305    set peaknums [refposvec search $xmin $xmax]
306    set peaklist {}
307    set xcen 0
308    # select by displayed phases
309    set lbls 0
310#    puts ""
311    foreach peak $peaknums {
312#       puts "hkl [lindex $refhkllist $peak] phase [lindex $refphaselist $peak]"
313        if [set peakinfo(flag[lindex $refphaselist $peak])] {
314            set xcen [expr $xcen + [refposvec range $peak $peak]]
315            lappend peaklist [lindex $refhkllist $peak]
316            incr lbls
317        }
318    }
319    if {$peaklist == ""} return
320    set xcen [expr $xcen / $lbls]
321    # avoid bug in BLT 2.3 where Inf does not work for text markers
322    if {$blt_version == 2.3} {
323        set ycen [lindex [$plot yaxis limits] 1]
324    } else  {
325        set ycen Inf
326    }
327    set mark [$plot marker create text -coords "$xcen $ycen" \
328            -rotate 90 -text $peaklist -anchor n -bg ""]
329    after 10000 "$plot marker delete $mark"
330}
331
332proc plotdata {box} {
333    global expnam hst peakinfo xunits yunits cycle reflns modtime
334    global lasthst graph
335
336    # is there a new histogram to load?
337    if {$hst != $lasthst} {
338        xvec set {}
339        xvec notify now
340        set cycle -1
341        set modtime 0
342        $box config -title "Please wait: loading histogram $hst"
343        update
344        return
345    }
346    xvec notify now
347    obsvec notify now
348    calcvec notify now
349    bckvec notify now
350    diffvec notify now
351    $box config -title "$expnam cycle $cycle Hist $hst"
352    $box xaxis config -title $xunits
353    $box yaxis config -title $yunits
354    setlegend $box $graph(legend)
355    # now deal with peaks
356    set j 0
357    for {set i 1} {$i < 10} {incr i} {
358        if [set peakinfo(flag$i)] {
359            foreach X $reflns($i) {
360                incr j
361                catch {
362                    $box marker create line -name peaks${i}_$j
363                }
364                $box marker config peaks${i}_$j  -under 1 \
365                        -coords "$X $peakinfo(min$i) $X $peakinfo(max$i)"
366                $box marker config peaks${i}_$j \
367                        $graph(MarkerColorOpt) $peakinfo(color$i)
368                if $peakinfo(dashes$i) {
369                    catch {
370                        $box marker config peaks${i}_$j -dashes "5 5"
371                    }
372                }
373            }
374            # $box element config phase$i -mapped  1
375            catch {$box element create phase$i}
376            catch {
377                $box element config phase$i -color $peakinfo(color$i)
378            }
379        } else {
380            eval $box marker delete [$box marker names peaks${i}_*]
381            eval $box element delete [$box element names phase$i]
382        }
383    }
384    # force an update of the plot as BLT may not
385    $box config -title [$box cget -title]
386    update
387}
388
389proc setlegend {box legend} {
390    global blt_version
391    if {$blt_version >= 2.3 && $blt_version < 8.0} {
392        if $legend {
393            $box legend config -hide no
394        } else {
395            $box legend config -hide yes
396        }
397    } else {
398        if $legend {
399            $box legend config -mapped yes
400        } else {
401            $box legend config -mapped no
402        }
403    }
404}
405
406proc minioptionsbox {num} {
407    set bx .opt$num
408    catch {destroy $bx}
409    toplevel $bx
410    wm iconname $bx "Phase $num options"
411    wm title $bx "Phase $num options"
412
413    set i $num
414        pack [label $bx.0 -text "Phase $i reflns" ] -side top
415        pack [checkbutton $bx.1 -text "Show reflections" \
416                -variable peakinfo(flag$i)] -side top
417        pack [checkbutton $bx.2 -text "Use dashed line" \
418                -variable peakinfo(dashes$i)] -side top
419        pack [frame $bx.p$i -bd 2 -relief groove] -side top
420#       pack [checkbutton $bx.p$i.0 -text "Show phase $i reflns" \
421#               -variable peakinfo(flag$i)] -side left -anchor w
422        pack [label $bx.p$i.1 -text "  Y min:"] -side left
423        pack [entry $bx.p$i.2 -textvariable peakinfo(min$i) -width 5] \
424                -side left
425        pack [label $bx.p$i.3 -text "  Y max:"] -side left
426        pack [entry $bx.p$i.4 -textvariable peakinfo(max$i) -width 5] \
427                -side left
428        pack [frame $bx.c$i -bd 2 -relief groove] -side top
429
430        pack [label $bx.c$i.5 -text " color:"] -side left
431        pack [entry $bx.c$i.6 -textvariable peakinfo(color$i) -width 12] \
432                -side left
433        pack [button $bx.c$i.1 -text "Color menu" \
434                -command "setcolor $i"] -side left
435
436    pack [frame $bx.b] -side top
437    pack [button $bx.b.1 -command {plotdata $box} -text "Update Plot"] \
438            -side left
439    pack [button $bx.b.4 -command "destroy $bx" -text Close ] -side right
440}
441
442proc setcolor {num} {
443    global peakinfo
444    set color [tk_chooseColor -initialcolor $peakinfo(color$num) -title "Choose color"]
445    if {$color == ""} return
446    set peakinfo(color$num) $color
447}
448proc makepostscriptout {} {
449    global graph box
450    if !$graph(printout) {
451        set out [open "| $graph(outcmd) >& liveplot.msg" w]
452        catch {
453            puts $out [$box postscript output -landscape 1 \
454                -decorations no -height 7.i -width 9.5i]
455            close $out
456        } msg
457        catch {
458            set out [open liveplot.msg r]
459            if {$msg != ""} {append msg "\n"}
460            append msg [read $out]
461            close $out
462            catch {file delete liveplot.msg}
463        }
464        if {$msg != ""} {
465            tk_dialog .msg "file created" \
466                    "Postscript file processed with command \
467                    $graph(outcmd). Result: $msg" "" 0 OK
468        } else {
469            tk_dialog .msg "file created" \
470                    "Postscript file processed with command \
471                    $graph(outcmd)" "" 0 OK
472        }
473    } else {
474        $box postscript output $graph(outname) -landscape 1 \
475                -decorations no -height 7.i -width 9.5i   
476        tk_dialog .msg "file created" \
477                "Postscript file $graph(outname) created" "" 0 OK
478    }
479}
480
481proc setprintopt {page} {
482    global graph
483    if $graph(printout) {
484        $page.4.1 config -fg black
485        $page.4.2 config -fg black -state normal
486        $page.6.1 config -fg #888
487        $page.6.2 config -fg #888 -state disabled
488    } else {
489        $page.4.1 config -fg #888
490        $page.4.2 config -fg #888 -state disabled
491        $page.6.1 config -fg black
492        $page.6.2 config -fg black -state normal
493    }
494}
495
496proc setpostscriptout {} {
497    global graph tcl_platform
498    set box .out
499    catch {destroy $box}
500    toplevel $box
501    focus $box
502    pack [frame $box.4] -side top -anchor w -fill x
503    pack [checkbutton $box.4.a -text "Write PostScript files" \
504            -variable graph(printout) -offvalue 0 -onvalue 1 \
505            -command "setprintopt $box"] -side left -anchor w
506    pack [entry $box.4.2 -textvariable graph(outname)] -side right -anchor w
507    pack [label $box.4.1 -text "PostScript file name:"] -side right -anchor w
508    pack [frame $box.6] -side top -anchor w -fill x
509    pack [checkbutton $box.6.a -text "Print PostScript files" \
510            -variable graph(printout) -offvalue 1 -onvalue 0 \
511            -command "setprintopt $box" ] -side left -anchor w
512    pack [entry $box.6.2 -textvariable graph(outcmd)] -side right -anchor w
513    pack [label $box.6.1 -text "Command to print files:"] -side right -anchor w
514
515    pack [button $box.a -text "Close" -command "destroy $box"] -side top
516    if {$tcl_platform(platform) == "windows"} {
517        set graph(printout) 1
518        $box.4.a config -state disabled
519        $box.6.a config -fg #888 -state disabled
520    }
521    setprintopt $box
522}
523
524# save some of the global options in ~/.gsas_config
525proc SaveOptions {} {
526    global graph
527    set fp [open [file join ~ .gsas_config] a]
528    puts $fp "set graph(legend) $graph(legend)"
529    puts $fp "set graph(printout) $graph(printout)"
530    puts $fp "set graph(outname) $graph(outname)"
531    puts $fp "set graph(outcmd) $graph(outcmd)"
532    close $fp
533}
534
535proc aboutliveplot {} {
536    global Revision
537    tk_dialog .warn About "
538GSAS\n\
539A. C. Larson and\n R. B. Von Dreele,\n LANSCE, Los Alamos\n\n\
540LIVEPLOT\nB. Toby, NIST\nNot subject to copyright\n\n\
541$Revision\n\
542" {} 0 OK
543}
544
545proc getcycle {} {
546    global expnam
547    set cycle -1
548    catch {
549        set fp [open $expnam.EXP r]
550        set text [read $fp]
551        close $fp
552        regexp {GNLS  RUN.*Total cycles run *([0-9]*) } $text x cycle
553    }
554    return $cycle
555}
556
557proc updateifnew {} {
558    global cycle modtime expnam
559    if {[file mtime $expnam.EXP] != $modtime} {
560        set modtime [file mtime $expnam.EXP]
561        set newcycle [getcycle]
562        if {$newcycle != $cycle} {
563            set cycle $newcycle
564            # delay one second
565            # after 1000
566            readdata .g
567        }
568    }
569    # check every second
570#    after 10000 updateifnew
571    after 1000 updateifnew
572}
573
574# fetch EXP file processing routines
575source [file join $expgui(scriptdir) readexp.tcl]
576
577set fl [file join $expgui(scriptdir) icddcmd.tcl]
578if [file exists $fl] {source $fl}
579set fl [file join $expgui(scriptdir) cellgen.tcl]
580if [file exists $fl] {source $fl}
581
582# override options with locally defined values
583if [file exists [file join $expgui(scriptdir) localconfig]] {
584    source [file join $expgui(scriptdir) localconfig]
585}
586if [file exists [file join ~ .gsas_config]] {
587    source [file join ~ .gsas_config]
588}
589
590if [file executable [file join $expgui(gsasexe) $expgui(tcldump)]] {
591    set expgui(tcldump) [file join $expgui(gsasexe) $expgui(tcldump)]
592#    puts "got tcldump"
593} else {
594    set expgui(tcldump) {}
595#    puts "no tcldump"
596}
597
598# vectors
599vector xvec
600xvec notify never
601vector obsvec
602obsvec notify never
603vector calcvec
604calcvec notify never
605vector bckvec
606bckvec notify never
607vector diffvec
608diffvec notify never
609vector refposvec
610refposvec notify never
611# create the graph
612set box [graph .g]
613Blt_ZoomStack $box
614$box element create obs -color black -symbol scross -linewidth 0
615$box element create calc -color red  -symbol none 
616$box element create diff -color blue  -symbol none 
617$box element config obs -xdata xvec -ydata obsvec
618$box element config calc -xdata xvec -ydata calcvec
619$box element config diff -xdata xvec -ydata diffvec
620if {$expgui(tcldump) != ""} {
621    $box element create bckg -color green  -symbol none 
622    $box element config bckg -xdata xvec -ydata bckvec
623    bind $box <Shift-Button-1> "lblhkl %W %x"
624}
625$box yaxis config -title {}
626setlegend $box $graph(legend)
627# create a set of markers for each phase
628for {set i 1} {$i < 10} {incr i} {
629    set peakinfo(flag$i) 0
630    set peakinfo(max$i) Inf
631    set peakinfo(min$i) -Inf
632    set peakinfo(dashes$i) 1
633}
634
635updateifnew
636frame .a -bd 3 -relief groove
637pack [menubutton .a.file -text File -underline 0 -menu .a.file.menu] -side left
638menu .a.file.menu
639.a.file.menu add cascade -label "Histogram" -menu .a.file.menu.hist
640menu .a.file.menu.hist
641for {set num 1} {$num < 99} {incr num 10} {
642    .a.file.menu.hist add cascade -label "$num-[expr $num+9]" \
643            -menu .a.file.menu.hist.$num
644    menu .a.file.menu.hist.$num
645    for {set num1 $num} {$num1 < 10+$num} {incr num1} {
646        .a.file.menu.hist.$num add radiobutton -label $num1 -value $num1 \
647                -variable hst \
648                -command {set cycle [getcycle];readdata .g}
649    }
650}
651.a.file.menu add cascade -label Tickmarks -menu .a.file.menu.tick
652menu .a.file.menu.tick
653foreach num {1 2 3 4 5 6 7 8 9} {
654    .a.file.menu.tick add checkbutton -label "Phase $num" \
655            -variable  peakinfo(flag$num) \
656            -command {plotdata $box}
657}
658.a.file.menu add command -label "Update Plot" \
659        -command {set cycle [getcycle];readdata .g}
660.a.file.menu add command -label "Make PostScript" -command makepostscriptout
661.a.file.menu add command -label Quit -command "destroy ."
662
663pack [menubutton .a.options -text Options -underline 0 -menu .a.options.menu] \
664        -side left   
665menu .a.options.menu
666.a.options.menu add cascade -label "Configure Tickmarks" -menu .a.options.menu.tick
667menu .a.options.menu.tick
668foreach num {1 2 3 4 5 6 7 8 9} {
669    .a.options.menu.tick add command -label "Phase $num" \
670            -command "minioptionsbox $num"
671}
672if {$expgui(tcldump) != ""} {
673    .a.options.menu add cascade -label "X units" -menu .a.options.menu.xunits
674    menu .a.options.menu.xunits
675    .a.options.menu.xunits add radiobutton -label "As collected" \
676            -variable graph(xunits) -value 0 \
677            -command {set cycle [getcycle];readdata .g}
678    .a.options.menu.xunits add radiobutton -label "d-space" \
679            -variable graph(xunits) -value 1 \
680            -command {set cycle [getcycle];readdata .g}
681    .a.options.menu.xunits add radiobutton -label "Q" \
682            -variable graph(xunits) -value 2 \
683            -command {set cycle [getcycle];readdata .g}
684    .a.options.menu add cascade -label "Y units" -menu .a.options.menu.yunits
685    menu .a.options.menu.yunits
686    .a.options.menu.yunits add radiobutton -label "As collected" \
687            -variable graph(yunits) -value 0 \
688            -command {set cycle [getcycle];readdata .g}
689    .a.options.menu.yunits add radiobutton -label "Normalized" \
690            -variable graph(yunits) -value 1 \
691            -command {set cycle [getcycle];readdata .g}
692}
693   
694.a.options.menu add checkbutton -label "Include legend" \
695        -variable graph(legend) \
696        -command {setlegend $box $graph(legend)}
697.a.options.menu add command -label "Set PS output" -command setpostscriptout
698.a.options.menu add command -label "Save Options" -underline 1 \
699        -command "SaveOptions"
700
701pack [menubutton .a.help -text Help -underline 0 -menu .a.help.menu] -side right
702menu .a.help.menu -tearoff 0
703.a.help.menu add command -command aboutliveplot -label About
704
705pack .a -side top -fill both
706pack $box -fill both -expand yes
707donewait
Note: See TracBrowser for help on using the repository browser.