fast has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have this error when I select different month in the drop down box then hit "print value" any body know why or how to fix the error? There are no error if I don't click on the drop down.
Thanks in advance.# BrowseEntry, entry with listbox to select list values. use strict; use warnings; use Tk; use Tk::BrowseEntry; my $month = "January"; my $top = MainWindow->new; my $f = $top->Frame->pack; my $top_f = $f->Frame(-bg=>'red', -width=>'200')->pack; my $bot_f = $f->Frame(-bg=>'red', -width=>'200')->pack; my $c = $top_f->BrowseEntry(-label => "Month:", -variable => \$mon +th); $c->pack; $c->insert("end", "January"); $c->insert("end", "February"); $c->insert("end", "March"); $c->insert("end", "April"); $c->insert("end", "May"); $c->insert("end", "June"); $c->insert("end", "July"); $c->insert("end", "August"); $c->insert("end", "September"); $c->insert("end", "October"); $c->insert("end", "November"); $c->insert("end", "December"); $bot_f->Button(-text => "Print value", -command => sub { print "The month is $month\n"; $top_f->destroy if Tk::Exists($top_f); }, -relief => "raised")->pack; MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl TK BrowseEntry error
by stefbv (Priest) on Jan 10, 2010 at 17:20 UTC | |
|
Re: Perl TK BrowseEntry error
by biohisham (Priest) on Jan 10, 2010 at 17:58 UTC | |
|
Re: Perl TK BrowseEntry error
by ldln (Pilgrim) on Jan 10, 2010 at 18:54 UTC | |
|
Re: Perl TK BrowseEntry error
by fast (Novice) on Jan 10, 2010 at 19:46 UTC | |
by lamprecht (Friar) on Jan 10, 2010 at 21:48 UTC |