Grygonos has asked for the wisdom of the Perl Monks concerning the following question:
I have a listbox setup like so...
$remove_list->get('active')
defaults to the first value in the list. I would like to be able to check for the case of the user not selecting an option.
Does anyone know how this is possible?
Thanks for any help, Gry
This works fine. The problem is ... when I click Remove with nothing selected in the box#Create the tape removal dialog box my $remove_dialog = $win->DialogBox(-title=>'Choose a tape', -buttons=>["Remove", "Cancel"] +); #Create the listbox to hold the tape numbers my $remove_list = $remove_dialog->Listbox(-width=>'25', -height=>'5', -font=>$font)->pack; #Get the tapes that are stored my @stored_tapes = getTapes(); #Put each tape in the listbox foreach my $tape (@stored_tapes) {$remove_list->insert('end',$tape);} #Show the $remove_dialog box to the user my $remove_result = $remove_dialog->Show; if($remove_result eq "Remove") { my $test = $remove_list->get('active'); print $test; }
$remove_list->get('active')
defaults to the first value in the list. I would like to be able to check for the case of the user not selecting an option.
Does anyone know how this is possible?
Thanks for any help, Gry
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk Listbox problem
by jsprat (Curate) on Jul 21, 2003 at 17:52 UTC | |
Re: Tk Listbox problem
by bobn (Chaplain) on Jul 21, 2003 at 17:32 UTC | |
by Grygonos (Chaplain) on Jul 21, 2003 at 17:58 UTC | |
by bobn (Chaplain) on Jul 21, 2003 at 19:11 UTC | |
by Anonymous Monk on Jul 21, 2003 at 18:04 UTC | |
by jsprat (Curate) on Jul 21, 2003 at 18:14 UTC |
Back to
Seekers of Perl Wisdom