use strict; use Win32::GUI(); my $interval = 100; my $main = Win32::GUI::Window->new( -name => 'Main', -width => 150, -height => 100, -onTimer => \&redraw_Timer, ); $main->AddTimer( "redraw_Timer", $interval); $main->Show(); Win32::GUI::Dialog(); sub Main_Terminate { -1; } sub redraw_Timer{ my $temp = localtime; return $main->AddLabel(-text => $temp); } #### foreach (@test) { $_ =~ s/"//g; my (@color) = $change > 0 ? [ 0, 0, 255 ] : [ 255, 0, 0 ]; $main->AddLabel( -text => $arrow, -font => $arrow_font, -left => 55, -foreground => @color, -background => COLOR, -top => $h, ); # current security price $main->AddLabel( -text => pack( "A10", $current ), -font => $sec_font, -left => 70, -top => $h, -background => COLOR, ); # change in security price $main->AddLabel( -text => pack( "A10", $change ), -font => $sec_font, -left => 130, -top => $h, -background => COLOR, ); }