#!/usr/bin/perl use warnings; use strict; use Tk; my $top = MainWindow->new; $top->geometry('200x200+200+200'); $top->overrideredirect(1); $top->Button( -text => 'Maximize', -command => sub { $top->geometry($top->screenwidth . 'x' . $top->screenheight . '+0+0'); print "Maximized\n"; })->pack; $top->Button( -text => 'Exit', -command => sub { $top->destroy } )->pack; MainLoop;