CC: | slaven [...] rezic.de |
Subject: | Tk::Browseentry and destroy |
Dear,
If a try to destroy a browseentry widget after e selection, I have I bug.
Tk::Error: Can't call method "butUp" on an undefined value at
C:/Perl/site/lib/Tk/BrowseEntry.pm line 375.
<ButtonRelease-1>
(command bound to event)
That is the code :
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Tk;
use Tk::BrowseEntry;
my $window = MainWindow->new();
my $choice;
my $list = $window->BrowseEntry(
-label => 'Ligne : ',
-variable => \$choice,
-state => 'readonly',
-disabledforeground => 'black'
)->pack();
$list->insert( 'end', "hello" );
my $button = $window->Button(
-text => 'Valider',
-command => sub {
if ( defined $list and Exists($list) ) {
$list->destroy;
}
}
)->pack();
MainLoop;
__END__
Best Regards,
Djibril