Hlist

Johan Meskens CS3 jmcs3 <[email protected]> Sun, 16 Apr 2006 02:39:16 +0200
Newsgroups gmane.comp.lang.perl.tk
Organization INTERLICHTSPIELHAUS
Message-ID <[email protected]>
#This is perl, v5.8.7 built for i486-linux-gnu-thread-multi

hello
i am experiencing some trouble using the tk::hlist in an application
i thought i was doing something wrong
but using someone else's example script i experience the same problem
namely
 , the browsecommand and command options don't deliver anything to the
shift in the subroutine

############################################
use warnings;      
use strict;
use Tk;

use Tk::HList;
my $message = 'nothing yet ...';
my $mw = MainWindow->new;
$mw->title('Dialog');
my $label = $mw->Label(-textvariable => \$message);
my $exit = $mw->Button(-text => 'Exit',
                      -command => [$mw => 'destroy']);
my $hlist = $mw->Scrolled('HList',
                         -itemtype => 'text',
                         -separator => '/',
                         -selectmode => 'single',
                         -browsecmd => sub{ browse()},
                         -command => sub{ browse() }
                         );

my @dirs = qw(/ /home /home/joe /home/jane /usr
              /usr/lib /usr/bin /usr/man /usr/include /usr/local
              /usr/local/lib /usr/local/bin /usr/local/include
             );
$hlist->add($_, -text => $_) for @dirs;
$exit->pack(-side => 'bottom');
$label->pack(-side => 'top');
$hlist->pack;
MainLoop;
sub browse {
  my $choice = shift;
  $message = "You chose '$choice'";
}


__END__

i get the error when i click or double click: 
' Use of uninitialized value in concatenation (.) or string at ..

thanks
jmcs3



-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]