Given that code, how would I return the value of the selected item in the list? Tried some things, but I'm still new to Tk, and this is my first attempt on Tk::BrowseEntry. Any help would be greatly appreciated.#!/usr/bin/perl -w use strict; use Tk; use Tk::BrowseEntry; # Create the main window my $mw; $mw->{main} = MainWindow->new; # Create the browse entry $mw->{a} = $mw->{main}->BrowseEntry(-label => "Select one:")->pack; $mw->{a}->insert("end", "one"); $mw->{a}->insert("end", "two"); $mw->{a}->insert("end", "three"); my $frame = $mw->{main}->Frame()->pack(); $frame->Button(-text => "Ok", -command => \&return_value )->pack(-side => 'left'); $frame->Button(-text => "Exit", -command => sub{ $mw->{main}->destroy } )->pack(-side +=> 'left'); MainLoop; sub return_value { #return value of selected item here }
In reply to Tk::BrowseEntry return value by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |