Te following snipped code :
sub createWindow {
$height = 60;
$Window = new GUI::Window(
-name => "Window",
-text => "Spy Server",
-height => $height, -width => 85,
-left => 650, -top => 460,
);
$Rabo = $Window->AddButton(-name => "Rabo", -text => "Alert on/off",
-left => 5, -top => 5,);
$timer = new GUI::Timer($Window,"TimeEvent",60000);
$Window->Show();
Win32::GUI::Dialog();
}
sub TimeEvent_Timer() {
## Some code checking if a server is up or down
## When down --> send email and show messagebox (showAlert)
## The button is there to set the alert on or off
}
sub showAlert {
if ($alert =~/on/) {
Win32::MsgBox("Server Down", 0 | MB_ICONASTERISK, "$site[$i] is
down");
}
}
sub Rabo_Click {
## default value of alert = "on"
if ($alert =~/on/) {
$alert = "of";
}
if ($alert =~/of/) {
$alert = "on";
}
}
But the problem is is that when the messagebox appears and the user clicks on OK to
get rid of it, the window with the button is somehow blokked. It is not possible for
the user to click on button. Is it better to use an other Window to display the
message or is there an other solution to this problem ?
TIA,
Jorn