use strict; use warnings; use Tk; my $mw = tkinit; my $s = 'text'; my $b = $mw->BrowseEntry->pack; $mw->Button(-text => 'add entry', -command => sub{$b->insert('end',$s.='-foo'); $b->updateListWidth; } )->pack; MainLoop;