#!/usr/bin/perl use strict; use Tk; use Tk::BrowseEntry; my $mw = MainWindow->new; # Mainwindow: sizex/y, positionx/y $mw->geometry("200x200+100+120"); my $shortlist = [qw(a b c d)]; my $longlist = [qw(a b c d e f g h i j k l m n o p r s t u w)]; my $reallonglist =[(1..100)]; # Create dropdown and another element which shows my selection my $dropdown_value = 42; my $dropdown = $mw->BrowseEntry( -label => "Label", -choices => [('')], -variable => \$dropdown_value, -autolimitheight => 1 )->pack; $mw->Button( -text => "Short List", -command => sub{ $dropdown->configure(-choices => $shortlist)})->pack; $mw->Button( -text => "Long List", -command => sub{ $dropdown->configure(-choices => $longlist)})->pack; $mw->Button( -text => "RealLong List", -command => sub{ $dropdown->configure(-choices => $reallonglist)})->pack; MainLoop;