From: Louis B. <lb...@li...> - 2001-06-28 11:03:58
|
I am running the attached code on my win2k machine and I am seeing two=20 strange things. 1. When the window updates the Textfields flicker and the data in them=20 flicker. Is there anyway to get rid of that??? 2. When I update the numbers in the Textfields I have noticed that windows= =20 keeps a memory of their previous values. When the above flicker happens I= =20 see the previous value for a brief micro second. It is most annoying. Is= =20 there any way I can fix that. In both cases I do want to keep the refresh time very low (less then 5=20 seconds). Thanks, Louis use Win32::GUI; use Net::FTP; foreach (@ARGV) { $UserInfo[$i]=3D$_; $i++; } &usage if $i<3; ############################### # Variables ############################### $FTPServer =3D $UserInfo[0]; $FTPUser =3D $UserInfo[1];; $FTPPasswd =3D $UserInfo[2];; $FTPUsersDir =3D "/tmp"; $FTPUsersTmpFile =3D "listevents.out"; $UsersFile =3D "c:\\temp\\listevents.out"; ############################### $W =3D new Win32::GUI::Window( -title =3D> "Win32::GUI::Louis Test", -left =3D> 100, -top =3D> 100, -width =3D> 225, -height =3D> 200, -font =3D> $F, -name =3D> "MainWindow", ); $tX =3D 5; $W->AddLabel( -name =3D> "Processed_Label", -text =3D> "Processed:", -left =3D> $tX, -top =3D> $tX, ); $tYp =3D $W->Processed_Label->Height + 20 +$tX; $W->AddLabel( -name =3D> "Queued_Label", -text =3D> "Queued:", -left =3D> $tX, -top =3D> $tYp, ); $tYq =3D $W->Queued_Label->Height + 20 + $tYp; $W->AddLabel( -name =3D> "Waiting_Label", -text =3D> "Waiting:", -left =3D> $tX, -top =3D> $tYq, ); $tYw =3D $W->Waiting_Label->Height + 20 + $tYq; $W->AddLabel( -name =3D> "ParsingFailed_Label", -text =3D> "ParsingFailed:", -left =3D> $tX, -top =3D> $tYw, ); $tYpf =3D $W->ParsingFailed_Label->Height + 20 +$tYw; $W->AddLabel( -name =3D> "Repository_Label", -text =3D> "Repository:", -left =3D> $tX, -top =3D> $tYpf, ); $sb =3D $W->AddStatusBar( -name =3D> "Status", -text =3D> "Event Server Running ", ); $tX_Processed +=3D $W->Processed_Label->Width + 27; $tX_Queued +=3D $W->Queued_Label->Width + 39; $tX_Waiting +=3D $W->Waiting_Label->Width + 41; $tX_ParsingFailed +=3D $W->ParsingFailed_Label->Width + 14; $tX_Repository +=3D $W->Repository_Label->Width + 27; ############################################ ############################################ # Process events to the window ############################################ ############################################ $W->Show; while (1) { $ftp=3DNet::FTP->new($FTPServer)|| die "FTP Users failed\n"; $ftp->login($FTPUser,$FTPPasswd)|| die "FTP login Users failed\n"; $ftp->cwd($FTPUsersDir) || die "FTP cd UsersFailed\n"; $ftp->get($FTPUsersTmpFile, $UsersFile)|| die "FTP get $FTPUsersTmpFile= =20 Failed $!\n"; $ftp->quit; open(File, "c:\\temp\\listevents.out")||die; while(<File>) { @Data=3D""; chomp; next if (! $_); @Data=3Dsplit(/-/,$_); } $W->AddTextfield( -name =3D> "Processed_Text", -left =3D> $tX_Processed, -top =3D> $tX, -width =3D> 80, -height =3D> 20, -text =3D> $Data[1], ); $W->AddTextfield( -name =3D> "Queued_Text", -left =3D> $tX_Queued, -top =3D> $tYp, -width =3D> 80, -height =3D> 20, -text =3D> $Data[2] ); $W->AddTextfield( -name =3D> "Waiting_Text", -left =3D> $tX_Waiting, -top =3D> $tYq, -width =3D> 80, -height =3D> 20, -text =3D> $Data[0], ); $W->AddTextfield( -name =3D> "ParsingFailed_Text", -left =3D> $tX_ParsingFailed, -top =3D> $tYw, -width =3D> 80, -height =3D> 20, -text =3D> $Data[3], ); $W->AddTextfield( -name =3D> "Repository_Text", -left =3D> $tX_Repository, -top =3D> $tYpf, -width =3D> 80, -height =3D> 20, -text =3D> $Data[4], ); $sb->Text("EventSvr $Data[5] $Data[6]"); Win32::GUI::PeekMessage(0,0,0); Win32::GUI::DoEvents() < 0; exit(0) if !$W->IsEnabled(); sleep(1); } ############################################ ############################################ # Subrouteens to run ############################################ ############################################ sub MainWindow_Terminate {-1;print "";} sub usage { } -- =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0= =BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 =A4=B0`=B0Lightbridge, Inc =A4=B0`=B067 South Bedford St. =A4=B0`=B0Burlington MA 01832 =A4=B0`=B0781.359.4795 mailto:lb...@li... =A4=B0`=B0http://www.lightbridge.com =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0= =BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 |