in reply to Re^3: Win32 GUI Window Problem
in thread Win32 GUI Window Problem
The problem I have now is that only the first set of windows (the data that was first wrote to the log file) appears. Does anyone have any thoughts on this?$filename="log3.txt"; open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; close TXT; open (TXT, ">$filename"); @alert = ['a'..'z']; $i=0, $p=1; while(@filedata || !@filedata) { if($filedata[0] =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; } shift(@filedata); ++$i; ++$p; if(!@filedata) { open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; open (TXT, ">$filename"); close TXT; &Loop; } } Win32::GUI::Dialog(); sub Loop { if($filedata[0] =~ /(\s+)(\d{1,4})(\.\d{1,4}){3}(\s+)/) { &Build_Window; Win32::GUI::Dialog(); } shift(@filedata); ++$i; ++$p; if(!@filedata) { open(TXT, $filename)||die("Could not open file!"); @filedata = <TXT>; close TXT; open (TXT, ">$filename"); close TXT; &Loop; } } sub Build_Window { $datetime = localtime(); $alert[$i] = new Win32::GUI::Window(-name => "Alert", -width = +> 500, -height => 150, -pos => [$p*2, $p*2]); $font = Win32::GUI::Font -> new(-name => "Arial", size => 46, +-bold => 1); $alert[$i] -> AddLabel(-text => $datetime, -font => $font); $alert[$i] -> AddLabel(-text => "SNORT ALERT: MALICIOUS BEHAVI +OR DETECTED!", -font => $font, -top => 50); $alert[$i] -> AddLabel(-text => $filedata[0], -font => $font, +-top => 75); my $t1 = $alert[$i] -> AddTimer('T1', 1000); Win32::Sound::Play("SystemExclamation"); $alert[$i] -> Show(); Win32::GUI::Dialog(); sub T1_Timer { return -1; } sub Alert_Terminate { return 1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Win32 GUI Window Problem
by BrowserUk (Patriarch) on Jan 28, 2009 at 05:51 UTC | |
by Acid Amygdala (Novice) on Feb 09, 2009 at 21:47 UTC | |
by BrowserUk (Patriarch) on Feb 09, 2009 at 22:33 UTC | |
by Acid Amygdala (Novice) on Feb 10, 2009 at 20:34 UTC |