Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Array to scroll..

by reneeb (Chaplain)
on Jul 27, 2006 at 13:51 UTC ( #564089=note: print w/replies, xml ) Need Help??

in reply to Array to scroll..

Do you want to show the values in the Tk::Text widget?

#!/usr/bin/perl -w use strict; use Tk; my @array=(100, 200, 300, 400 , 500); my $maincolor='red'; my $mw = MainWindow->new; $mw->minsize(qw(250 200)); #x y $mw->configure(-title=>'PROGRAM', -background=>$maincolor); my $frame_6=$mw->Frame(-borderwidth => 3, -background => $maincolor)-> +pack( -side=>'top', -fill=>'x'); $frame_6->Label(-text => 'Scroll', -background=>'yellow',)->pack(-side + =>'left'); my $scroll=$mw->Scrolled("Text", -scrollbars => 'e', -font => 'normal' +, -width => 10, -height => 10,)->pack; for(0..scalar(@array)-1){ $scroll->insert($_,$array[$_]); } MainLoop;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://564089]
roho replaces stale cookies with fresh on the platter on the sideboard.
roho takes a cookie from the platter on the sideboard.
roho takes a handful of cookies from the platter on the sideboard.
roho gets a cup of tea to dunk cookies.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-04-27 09:43 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (502 votes). Check out past polls.