It's basically the code I am using except I stripped out the database stuff and just went with a random number generator. I pulled the font stuff out because it was throwing an error and I didn't feel like debugging it.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('<ButtonRelease-1>', 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;
In reply to Re^2: scrolling MListbox in Perl/tk
by vortmax
in thread scrolling MListbox in Perl/tk
by vortmax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |