}
close $cl
-set chart [open |[list perl -we {
+set chart [exec perl -we {
use strict;
use CommodsScrape;
use IO::File;
sub { printf STDERR "warning: %s: incomprehensible: %s", @_; }
);
STDOUT->error and die $!;
-}] r]
+}]
frame .f -border 1 -relief groove
set canvas .f.c
}
}
-while {[gets $chart l] >= 0} {
+proc draw {} {
+ global chart count isleloc canvas
+
+ foreach l [split $chart "\n"] {
# puts "CHART-GOT $l"
set proc [lindex $l 0]
eval chart-got/$proc [lrange $l 1 end]
-}
-
-puts WILLSHOW
+ }
-set lastislandname {}
-foreach key [lsort [array names count]] {
+ set lastislandname {}
+ foreach key [lsort [array names count]] {
set c $count($key)
# puts "SHOWING $key $c"
regexp {^(.*) (\S+)$} $key dummy islandname abbrev
$canvas lower $bid $id
manyset $bbox dummy dummy dummy y
# puts "NEW Y $y"
+ }
}
+draw
+
foreach nk [lsort [array names $note]] {
puts "IGNORED NOTE $nk"
}
frame .ctrl.zoom
pack .ctrl.zoom -side top
-button .ctrl.zoom.out -text - -font {Courier 16}
-button .ctrl.zoom.in -text + -font {Courier 16}
+proc zoom {extail} {
+ global scale canvas
+ set nscale [expr "\$scale $extail"]
+ puts "ZOOM $scale $nscale"
+ if {$nscale < 1 || $nscale > 200} return
+ set scale $nscale
+ $canvas delete all
+ draw
+ panner::updatecanvas-bbox .ctrl.pan
+}
+
+button .ctrl.zoom.out -text - -font {Courier 16} -command {zoom /2}
+button .ctrl.zoom.in -text + -font {Courier 16} -command {zoom *2}
pack .ctrl.zoom.out .ctrl.zoom.in -side left
#. configure -width 640 -height 480