#!/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;
In reply to Re: scrolling MListbox in Perl/tk
by zentara
in thread scrolling MListbox in Perl/tk
by vortmax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |