#!/usr/bin/perl use Tk; my $mw = new MainWindow; my $currentSize = $mw->reqwidth . "x" . $mw->reqheight; $mw->bind( '<Configure>', [ \&OnResize, \$currentSize ] ); MainLoop; sub OnResize { my ( $mw, $oldSize ) = @_; my $newSize = $mw->width . "x" . $mw->height; if ( $$oldSize ne $newSize ) { ## Resize has occurred do something: printf( "Resize happened - old size: %s, new size: %s\n", $$oldSize, $newSize ); ## set the old size to the new size $$oldSize = $newSize; } }
In reply to Re: Tk Window Size
by zentara
in thread Tk Window Size
by Gwalchmai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |