Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Refresh data ina entry widget

by padawan_linuxero (Scribe)
on May 29, 2008 at 15:24 UTC ( #689040=note: print w/replies, xml ) Need Help??


in reply to Re: Refresh data ina entry widget
in thread Refresh data ina entry widget

Hi
I am trying really trying but can you please elaborate more on the pseudocode because i dont get it, please?

Replies are listed 'Best First'.
Re^3: Refresh data ina entry widget
by zentara (Archbishop) on May 29, 2008 at 19:16 UTC
    Pseudocode means "this is a non-functional shorthand view" of the steps you would need to take to write working code. I don't particularly like being asked to write code for someone who is getting paid for it. So here is a general purpose example, if you can't figure out the rest, you should read some books.
    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); my %data; foreach my $bank qw(aa bb cc dd){ $data{$bank}{'frame'} = $mw->Frame->pack(); $data{$bank}{'bankname'} = $bank; $data{$bank}{'status'} = 'offline'; $data{$bank}{'label'} = $data{$bank}{'frame'}->Label( -textvariable => \$data{$bank}{'bankname'})->pack(-side=>'left') +; $data{$bank}{'entry'} = $data{$bank}{'frame'}->Entry( -textvariable => \$data{$bank}{'status'}, -bg => 'white', )->pack(-side=>'right'); } $mw->repeat(2000, sub{ foreach my $bank (keys %data){ my $rand = rand 10; if ($rand > 5){ $data{$bank}{'status'} = 'online'; $data{$bank}{'entry'}->configure(-fg => 'red'); }else{ $data{$bank}{'status'} = 'offline'; $data{$bank}{'entry'}->configure(-fg => 'black'); } } }); MainLoop;

    I'm not really a human, but I play one on earth CandyGram for Mongo

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2019-07-19 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?