#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Font; sub change { my ($size_ref, $change, $l) = @_; $$size_ref += $change; $l->configure(-font => $l->fontCreate(-size => $$size_ref)); } my $mw = 'MainWindow'->new(-title => 'Scalable'); my $size = 12; my $font = $mw->fontCreate(-size => $size); my $l = $mw->Label(-text => 'Some text', -font => $font)->pack; my $f = $mw->Frame->pack; my $plus = $f->Button(-text => '+', -command => [\&change, \$size, 1, $l])->pack(-side => 'left'); my $minus = $f->Button(-text => '-', -command => [\&change, \$size, -1, $l])->pack(-side => 'right'); my $quit = $mw->Button(-text => 'Quit', -command => sub { exit })->pack; MainLoop();