in reply to scrolling MListbox in Perl/tk
#!/usr/bin/perl use Tk; use Tk::MListbox; use strict; use warnings; my $mw = new MainWindow(); $mw->fontCreate('big', -family=>'arial', -weight=>'bold', -size=> 18 ); $mw->fontCreate('medium', -family=>'arial', -weight=>'bold', -size=> 14 ); my $frame = $mw->Frame(-bd => 2, -relief => 'raised')->pack(-expand => + 1, -fill => 'both'); my $scrolledMListbox = $frame->Scrolled( qw/MListbox -selectmode browse -scrollbars oe -font medium / )->pack(-expand => 1, -fill => 'both'); $scrolledMListbox->columnInsert('end', -text => "Header",-font => 'bi +g'); $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"; } ); my $timer = $mw->repeat(1000,sub{ $scrolledMListbox->insert('end', [int rand 20] ); }); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: scrolling MListbox in Perl/tk
by vortmax (Acolyte) on Jul 16, 2008 at 19:40 UTC | |
by zentara (Cardinal) on Jul 16, 2008 at 20:00 UTC | |
by vortmax (Acolyte) on Jul 16, 2008 at 20:12 UTC | |
by Anonymous Monk on Sep 02, 2008 at 22:08 UTC | |
by zentara (Cardinal) on Sep 03, 2008 at 12:54 UTC | |
by Anonymous Monk on Sep 03, 2008 at 15:33 UTC | |
|