You might try the code I have replaced in the showAlert subroutine.

Eric Hansen


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Meijers J.
Sent: Thursday, October 07, 1999 4:45 AM
To: [EMAIL PROTECTED]
Subject: [perl-win32-gui] Enable Window


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");
          GUI::MessageBox("","$site\[$i\] is down","Server Down",48,);
        }
}

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


Reply via email to