#!/usr/bin/perl use strict; use warnings; use Tk; my ($width,$height) = (300,400); my $mw = tkinit; $mw->geometry( $width . 'x' . $height ); $mw->bind('', \&resize_mw); MainLoop; sub resize_mw{ my $ev = $mw->XEvent; if( $width != $ev->w or $height != $ev->h ){ $width = $ev->w; $height = $ev->h; print "Fenstergroesse veraendert\n"; } }