Changeset 6 for trunk/lstview
- Timestamp:
- Dec 4, 2009 4:58:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lstview
- Property rcs:date changed from 1998/11/23 17:57:08 to 1998/11/23 19:34:03
- Property rcs:rev changed from 1.1 to 1.2
- Property rcs:lines set to +23 -16
r5 r6 1 1 #!/usr/local/bin/wish 2 set Revision {$Revision$ $Date$} 2 3 # display a .LST file in a text box 3 4 # updates 8/26 add bindings for page-up, -down, uparrow, downarrow … … 27 28 } 28 29 set box {} 30 set txtvw(followcycle) 1 29 31 # override options with locally defined values 30 32 if [file exists ~/.textview_config] { … … 61 63 global txtvw valuelst 62 64 set i 0 65 set lastpos {} 63 66 # loop over cycles 64 67 set startpos $pos … … 71 74 $win tag add cycle $line.1 $line.10 72 75 incr i 73 scan [$win get $pos $line.end] %s%d x cycle 74 set txtvw(lastcycle) "Cycle $cycle" 75 .a.goto.menu entryconfigure 1 -state normal 76 $menu insert 1 command \ 77 -font 6x12 \ 78 -label "Cycle $cycle" \ 79 -command "$win see $pos" 80 if {[$menu index end] > $txtvw(menulength)} {$menu delete end} 81 76 set cycle {} 77 regexp {Cycle *([0-9]+) +There} [$win get $pos $line.end] x cycle 78 if {$cycle != ""} { 79 set lastpos $pos 80 set txtvw(lastcycle) "Cycle $cycle" 81 .a.goto.menu entryconfigure 1 -state normal 82 $menu insert 1 command \ 83 -font 6x12 \ 84 -label "Cycle $cycle" \ 85 -command "$win see $pos" 86 if {[$menu index end] > $txtvw(menulength)} {$menu delete end} 87 } 82 88 # get next cycle number 83 89 set nextpos [$win search -regexp -count chars \ … … 135 141 set pos $nextpos 136 142 } 143 if {$txtvw(followcycle) && $lastpos != ""} {$win see $lastpos} 137 144 } 138 145 … … 288 295 289 296 proc aboutgsas {} { 290 tk_dialog .warn About { 291 GSAS (Generalized Structure Analysis System) 292 293 A. C. Larson and R. B. Von Dreele, LANSCE, Los Alamos 294 295 GUI menu by B. Toby, NIST 296 } {} 0 OK 297 tk_dialog .warn About " 298 GSAS\n\ 299 A. C. Larson and\n R. B. Von Dreele,\n LANSCE, Los Alamos\n\n\ 300 TEXTVIEW\nB. Toby, NIST\nNot subject to copyright\n\n\ 301 $Revision\n\ 302 " {} 0 OK 297 303 } 298 304 … … 323 329 -side left 324 330 menu .a.goto.menu 331 .a.goto.menu add checkbutton -label "Auto Advance" -variable txtvw(followcycle) 325 332 .a.goto.menu add cascade -label "Cycle #" -menu .a.goto.menu.cyc \ 326 333 -state disabled
Note: See TracChangeset
for help on using the changeset viewer.