Changeset 563
- Timestamp:
- Dec 4, 2009 5:08:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/liveplot
- Property rcs:date changed from 2002/01/22 22:16:51 to 2002/02/11 19:32:02
- Property rcs:lines changed from +616 -183 to +30 -2
- Property rcs:rev changed from 1.26 to 1.27
r537 r563 1806 1806 } 1807 1807 1808 # define a binding to show the cursor location 1809 proc ToggleLiveCursor {} { 1810 global box graph 1811 if {[bind $box <Any-Motion>] == ""} { 1812 .a.options.menu entryconfig $graph(CursorLabel) -label "Hide Cursor Position" 1813 pack [frame .bot -bd 2 -relief sunken] -side bottom -fill x 1814 pack [label .bot.val1 -textvariable graph(position)] -side left 1815 pack [button .bot.close -command ToggleLiveCursor -text "Close cursor display"] -side right 1816 bind $box <Any-Motion> {FormatLiveCursor %x %y} 1817 } else { 1818 .a.options.menu entryconfig $graph(CursorLabel) -label "Show Cursor Position" 1819 destroy .bot 1820 bind $box <Any-Motion> {} 1821 } 1822 } 1823 proc FormatLiveCursor {x y} { 1824 global graph 1825 set graph(position) \ 1826 "x=[format %.3f [$graph(blt) xaxis invtransform $x]] y=[format %.3f [$graph(blt) yaxis invtransform $y]]" 1827 } 1828 #------------------------------------------------------------------------- 1829 1830 1808 1831 # override options with locally defined values 1809 1832 if [file exists [file join $expgui(scriptdir) localconfig]] { … … 2016 2039 -variable graph(legend) \ 2017 2040 -command {setlegend $box $graph(legend)} 2041 .a.options.menu add command -label "Show Cursor Position" \ 2042 -command ToggleLiveCursor 2043 set graph(CursorLabel) [.a.options.menu index "Show Cursor Position"] 2018 2044 .a.options.menu add command -label "Set PS output" -command setpostscriptout 2019 2045 .a.options.menu add cascade -menu .a.options.menu.font \ … … 2205 2231 set cycle [getcycle];readdata .g 2206 2232 } 2233 bind . <Key-l> {ToggleLiveCursor} 2234 bind . <Key-L> {ToggleLiveCursor} 2207 2235 updateifnew 2208 2236 donewaitmsg
Note: See TracChangeset
for help on using the changeset viewer.