Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: print output to screen in table that updates?

by zentara (Archbishop)
on Nov 09, 2012 at 11:36 UTC ( #1003104=note: print w/ replies, xml ) Need Help??


in reply to print output to screen in table that updates?

Are you stuck on Text::Table and console mode? It seems that an event-based gui might be useful too. Like Tk or Gtk2 or Wx.

With a GUI you could make a nice Table display, and upgrade progress thru the Table. Here is a simple example to show you what it might look like.

#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::TableMatrix; my $top = MainWindow->new; my $stuff = {}; my $tg = $top->Scrolled( 'TableMatrix', -rows => 21, -cols => 11, -width => 10, -height => 20, -titlerows => 1, -titlecols => 1, -variable => $stuff, -selectmode => 'extended', -resizeborders => 'both', -titlerows => 1, -titlecols => 1, -bg => 'white', )->pack( -expand => 1, -fill=>'both' ); $tg->tagConfigure('active', -bg => 'gray90', -relief => 'sunken') + ; $tg->tagConfigure('title', -bg => 'gray85', -fg => 'black', -relief => + 'sunken') ; $top->Button( -text=>'modify', -command=> sub { $stuff->{'3,3'} = 'asfasf'; #&TMRefresh($tg); $tg->configure(-padx =>( $tg->cget(-padx))); }, )->pack; Tk::MainLoop; sub TMRefresh { #Required input TableMatrix object. #use to force matrix to update, a code trick return if (!$_[0]); $_[0]->configure(-padx =>($_[0]->cget(-padx))); } ###################################################################### +###

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: print output to screen in table that updates?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-09-24 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls