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)]; &create_dropdown($mw); MainLoop; sub create_dropdown { my $mother = shift; # Create dropdown and another element which shows my selection my $dropdown_value; my $dropdown; my $frame = $mother->Frame->pack; $dropdown = dropDown($dropdown,$frame,\$dropdown_value,$longlist); $mother->Button( -text => "Short List", -command => sub{$dropdown = dropDown($dropdown,$frame,\$dropdown_value,$sh +ortlist)})->pack; $mother->Button( -text => "Long List", -command => sub{$dropdown = dropDown($dropdown,$frame,\$dropdown_value,$lo +nglist)})->pack; return; } sub dropDown{ my ($oldDropdown, $frame,$dropdown_value,$options) = @_; $oldDropdown->destroy if $oldDropdown; my $dropdown = $frame->BrowseEntry( -label => "Label", -variable => $dropdown_value, -autolimitheight => 1, -choices => $options ); $dropdown->grid(-row=>1,-column=>1); $dropdown; }
In reply to Re: BrowseEntry scrollbar not updating
by TheForeigner
in thread BrowseEntry scrollbar not updating
by smaclach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |