Well, even the simplified version will be quite long. I have described the entire thing here, but may be it is not sufficient for you to guess.
FYI, I am giving the update gui routine here, which is getting called from the server function as and when it has read some data from the socket.
sub updateGui {
my $self = shift;
my $data = shift;
my $hlist = $self->{jobTree};
my @cellInfo = split( /\s/, $data );
my $font = "{helvetica} -12 bold";
my $style1 = $self->{displaybaseObj}->getItemStyle(
$hlist, 'text',
-foreground => 'black',
-anchor => 'nw',
-background => "$cellInfo[2]",
-font => $font
);
my $num1 = int( rand(2) ) + 1;
my $num2 = int( rand(2) ) + 0;
my $subnode1 = $cellInfo[0] . "." . $num1;
my $subnode2 = $cellInfo[0] . "." . $num1 . "." . "0" . "." . $num
+2;
$hlist->itemConfigure(
$subnode1, 2,
-text => "$cellInfo[1]",
-style => $style1
);
$hlist->itemConfigure(
$subnode2, 2,
-text => "$cellInfo[1]",
-style => $style1
);
}
The $data to this routine is like "500 running green" i.e a gui row , some status of that and a colour separated by single space. $hlist is the Tree widget which just a bit extension of the built in HList.pm Tk module.
Let me see , if I can post a very simplified version of it.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.