Detecting mouse button up after resizing window



Hi,

I would like to have a "resize" callback that is only executed once at
the end of a resize event (ie, when the mouse button is released after
dragging a corner of the main window).  The code below works, but I get
resize events continuously while the window is being resized.  Is there
a way to capture a ButtonRelease event at the end of a resize?  I've
tried binding to ButtonRelease events but they do not appear to be captured
while the mouse pointer is on the border of a window.  I guess the window
manager is capturing those events.

#!/usr/bin/perl -w
use strict;
use Tk;
my $main = new MainWindow;
my $image = $main->Photo();
my $label = $main->Label(-image=>$image, -width=>100, -height=>100)->pack(-expand=>1, -fill=>'both');
$label->bind('<Configure>', \&displayImage);
MainLoop;


sub displayImage {
   print("resize\n");
   return;
   }
.