smaclach has asked for the wisdom of the Perl Monks concerning the following question:
#!/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)]; &create_dropdown($mw); MainLoop; sub create_dropdown { my $mother = shift; # Create dropdown and another element which shows my selection my $dropdown_value; my $dropdown = $mother->BrowseEntry( -label => "Label", -variable => \$dropdown_value, -autolimitheight => 1 )->pack; $mother->Button( -text => "Short List", -command => sub{ $dropdown->configure(-choices => $shortlist)})->pack; $mother->Button( -text => "Long List", -command => sub{ $dropdown->configure(-choices => $longlist)})->pack; # Populate dropdown with values $dropdown->configure(-choices => $longlist, -autolimitheight => 1) +; return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: BrowseEntry scrollbar not updating
by TheForeigner (Initiate) on Nov 14, 2007 at 22:04 UTC | |
|
Re: BrowseEntry scrollbar not updating
by zentara (Cardinal) on Nov 15, 2007 at 14:44 UTC | |
|
Re: BrowseEntry scrollbar not updating
by smaclach (Initiate) on Nov 15, 2007 at 20:08 UTC | |
|
Re: BrowseEntry scrollbar not updating
by Anonymous Monk on Sep 17, 2011 at 11:06 UTC |