sub AlignAll{ my ($x1, $y1, $x2, $y2); my $i; my $location; foreach $i (0 .. 3) { # Reposition scrollbar to the middle my $sbar = $sc[$i]->Subwidget('xscrollbar'); my @range = $sbar->get(); my $size = ($range[1] - $range[0]) / 2; $sbar->set(0.5 - $size, 0.5 + $size); ($x1, $y1, $x2, $y2) = $sc[$i]->bbox('rect'); $location =int(($x1+$x2)/2); warn("$location"); } }