use strict; use warnings; use Tk; my $main = MainWindow->new (-title => "Optionmenu demo"); my $id = 'Some different one'; my $IDLabel = $main->Label (-text => 'ID name: ', -anchor => 'w'); my $IDText = $main->Optionmenu ( -height => 1, -width => 40, -variable => \$id, ); $IDLabel->form (-left => '%0', -right => $IDText, -top => '%0'); $IDText->form (-right => '%100', -top => '%0'); $IDText->configure (-options => ['This one', 'That one', 'The other one']); MainLoop;