BEGIN {
    require Tk;
    import Tk;
}
require "varwatcher.pl";

$top = tkinit;
$count = 0;
tkpack Button::new($top, "-text" => "increment", "-method" => "::incr"),
       Varwatcher::new($top, "count", \$count);
tkmainloop;

sub incr {
    $count++;
}

