BEGIN {
    require Tk;
    import Tk;
}
$top = tkinit;
$foo = "Hello world";
$s = Scrollbar::new($top, "-orient" => "horizontal");
$e = Entry::new($top, "-textvariable" => $foo,
                      "-slave"        => $s,
                      "-method"       => "set");
$s->configure("-slave"  => $e,
              "-method" => "view");
$b = Button::new($top, "-text"   => "append",
                       "-method" => "::appendentry");
tkpack $s, $e, $b,
        "-side"   => "top",
        "-fill"   => "x",
        "-expand" => "y";
tkmainloop;

sub appendentry {
    $foo .= " again";
}
