Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use Tk::BrowseEntry; my @items; my $BrowseEntryindex; my $mw = MainWindow->new(); $items[0]{'cmd'} = sub{print "First BrowseEntry Index Selected\n"}; $items[1]->{'cmd'} = sub{print "Second BrowseEntry Index Selected\n"}; #Need to set $BrowseEntryindex to the index number of the selected ite +m in $dropdown my $dropdown = $mw->BrowseEntry( -label => 'Items', -browsecmd => sub{ + $items[$BrowseEntryindex]{'cmd'}; } )->pack; $dropdown->insert('end', 'First'); $dropdown->insert('end', 'Second'); $mw->MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I get the index of the currently selected Tk::BrowseEntry element?
by biohisham (Priest) on Feb 28, 2010 at 13:16 UTC | |
|
Re: How can I get the index of the currently selected Tk::BrowseEntry element?
by hangon (Deacon) on Feb 28, 2010 at 06:56 UTC | |
|
Re: How can I get the index of the currently selected Tk::BrowseEntry element?
by Anonymous Monk on Feb 28, 2010 at 06:41 UTC | |
|
Re: How can I get the index of the currently selected Tk::BrowseEntry element?
by glenn (Scribe) on Jan 24, 2014 at 22:57 UTC |