Louis wrote:
sub Exit_Click {$W->PostQuitMessage(0);}

Now I know that this sub is executing because I can put a print in it and I will see it on the console window. However, it is not quitting the program. How do I do that???

Normally, you exit the Win32::GUI::Dialog event loop with the PostQuitMessage, or by returning -1 from an event handler (more common).

But, you don't use the Dialog sub, you use your own main loop, using DoEvents. So it's up to you to keep track of when you should exit that loop using a flag of some sort. For example, you have

    exit(0) if !$W->IsEnabled();

So, the proper thing in this case would be to use the Enable() status of the window to indicate "keep on running". $W->Enable(0) in the menu or button event handler perhaps?


/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


Reply via email to