#!/usr/bin/perl use Tk; $radius = 3; sub nextone { $canvas->delete('all'); if ($n == $lines) { $_ = <>; exit unless $_; ($lines, $glyph) = split; $n = 0; } $n++; $label->configure(text => "'$glyph', $n of $lines"); $_ = <>; @a = split; $_ = shift(@a); $ox = shift @a; $oy = shift @a; $canvas->create('oval', $ox - $radius, $oy - $radius, $ox + $radius, $oy + $radius, fill => 'black'); while(@a) { $x = shift @a; $y = shift @a; $canvas ->create(line, $ox, $oy, $x, $y); $ox = $x; $oy = $y; } } $top = MainWindow->new(); $canvas = $top->Canvas(width => 256, height => 256)->pack(); $button = $top->Button(text => 'Next', command => \&nextone)->pack(); $label = $top->Label(text => '')->pack();; while(<>) { last if /^ /; } while(<>) { last if /^\d/; } ($lines, $glyph) = split; $n = 0; nextone(); MainLoop();