#!./perl
BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)) }
use Tk;

$top = tkinit;
$c = Canvas::new($top);
$c->create("text", 5, 150,
           "-text" => "Drag square by its border with mouse button 1.",
           "-anchor" => "nw");
$id = $c->create("rectangle", 10, 10, 80, 80);
$c->itemconfigure($id, "-width" => 7);
$mover = new CanvasMover ($c, $id);
$c->tkbind($id, "<ButtonPress-1>",   "pickup",  $mover);
$c->tkbind($id, "<B1-Motion>",       "drag",    $mover);
$c->tkbind($id, "<ButtonRelease-1>", "putdown", $mover);
tkpack $c;
tkmainloop;
