#!/usr/local/bin/perl use strict; use warnings; use Tk; my $top = MainWindow->new; my $text = $top->Scrolled('Text', -scrollbars => 'se', )->pack( -expand => 1, -fill => 'both' ); my ($mouse_x, $mouse_y); my $corner = $text->Subwidget('corner'); my $corner_label = $corner->Label( -image => $top->Photo( -format=>'gif', -data => 'R0lGODlhDAAMALMAAISChNTSzPz+/AAAAOAAyukAwRIA4wAAd8oA0MEAe+MTYHcAANAGgnsAAGAA AAAAACH5BAAAAAAALAAAAAAMAAwAAwQfMMg5BaDYXiw178AlcJ6VhYFXoSoosm7KvrR8zfXHRQA7' ), )->pack(-side => 'bottom', -anchor => 'se'); # I actually want a resize_nwse cursor, but this was the closest I could find $corner_label->bind('' => sub {$corner->configure(-cursor => 'sizing')}); $corner_label->bind('<1>' => sub { ($mouse_x, $mouse_y) = ($top->pointerx, $top->pointery) }); $corner_label->bind('' => sub { my $x = $top->width - $mouse_x + $top->pointerx; my $y = $top->height - $mouse_y + $top->pointery; ($mouse_x, $mouse_y) = ($top->pointerx, $top->pointery); $top->geometry($x.'x'.$y); }); MainLoop;