Thank you all.

I found I had to add the following before the sleep to terminate the loop:
   exit(0) if !$W->IsEnabled();

And change my terminate sub to the following:
        sub Window_Terminate {-1;print "";}

For some odd reason if I do not do a print the program will not terminate. Anyone have any ideas why???

Thanks,
Louis
At 03:00 PM 6/27/2001 +0200, Johan Lindstrom wrote:
Louis wrote:
$W = new Win32::GUI::Window(
    -title    => "Win32::GUI::Louis Test",
    -left     => 100,
    -top      => 100,
    -width    => 200,
    -height   => 150,
    -font     => $F,
    -name     => "Window",
);

Note the -name.


sub W_Terminate {-1;}

Note the name. You use the name of a variable you happened to assign the the object to. All event handlers are named after the -name option. This should work better:

sub Window_Terminate {-1;}

I often find that my event code never gets run and wonder why. Then I insert a little

 print "!";

in the handler sub and find that the event is never triggered at all... Oops :/ It is almost always caused by a misspelling or misunderstanding of the control name.


BTW, it may be a test thing, but "Window" is a lousy name for a lot of reasons, some actually important. I discuss this in The GUI Loft User Manual:

<http://www.bahnhof.se/~johanl/perl/Loft/manual.html#control%20names%20are%20global>


/J

------ ---- --- -- -- -- -  -   -    -        -
Johan Lindström                    Boss Casinos
Sourcerer                     [EMAIL PROTECTED]
                 http://www.bahnhof.se/~johanl/
If the only tool you have is a hammer,
everything tends to look
like a nail


_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

--
¤¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤
¤°`°Lightbridge, Inc
¤°`°67 South Bedford St.
¤°`°Burlington MA 01832
¤°`°781.359.4795 mailto:[EMAIL PROTECTED]
¤°`°http://www.lightbridge.com
¤¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤ø,¸¸,ø¤º°`°º¤øø¤º°`°º¤


Reply via email to