use warnings; use strict; use Tk; use Tk::Pane; use Tk::NoteBook; use DBI; use Tk::MListbox; ### Build Main Window # my $mainWindow = MainWindow->new; $mainWindow->geometry("800x600"); my $frame = $mainWindow->Frame(-bd => 2, -relief => 'raised')->pack(-expand => 1, -fill => 'both'); my $scrolledMListbox = $frame->Scrolled( qw/ MListbox -selectmode browse -scrollbars oe / )->pack(-expand => 1, -fill => 'both'); $scrolledMListbox->columnInsert('end', -text=>'Date', -sortable=>1, -width => 10); $scrolledMListbox->columnInsert('end', -text=>'Time', -sortable=>1, -width => 10); $scrolledMListbox->columnInsert('end', -text=>'Property', -sortable=>1, -width => 10); $scrolledMListbox->columnInsert('end', -text=>'Name', -sortable=>1, -width => 10); $scrolledMListbox->columnInsert('end', -text=>'Address', -sortable=>1, -width => 10); $scrolledMListbox->columnInsert('end', -text=>'Phone', -sortable=>1, -width => 10); $scrolledMListbox->bindRows('', sub { my ($w, $infoHR) = @_; print "@_\n"; print "You selected row: " . $infoHR->{-row} . " in column: " . $infoHR->{-column} . "\n"; print $scrolledMListbox->getRow( $scrolledMListbox->curselection()->[0] ),"\n"; } ); for (my $count = 100; $count >= 1; $count--){ $scrolledMListbox->insert('end', [[int rand 20], [int rand 20], [int rand 20], [int rand 20], [int rand 20], [int rand 20]]); } MainLoop;