use strict; use Tk; my $mw = MainWindow->new; our $viewbox = $mw->Listbox(-height=>'30',-width=>'70')->pack(-expand=>'1',-fill=>'both'); load($viewbox); MainLoop; sub load { my $idnum; my $tags; ($idnum,$tags) = (123,'tag1 tag2'); $viewbox->insert('end', "$idnum\t$tags"); } #### my $entry = $viewbox->curselection; print $viewbox->get($entry)."\n"; #### $viewbox->delete('active') #### my @contents = $viewbox->get('0','end'); foreach (@contents) {print "$_\n";}