in reply to Using Win32::GUI in a package

When you uncomment the line, you move your event handler subs from package main to package gui_test. But Win32::GUI doesn't know that.

To get Win32::GUI to call the event handler for the btnCancel_Click in the new package, I think you need to set the -name of the button to "gui_test::btnCancel".

That seems very impractical, so I never do that in my programs. I use modules and stuff though, but I always place my event handlers in package main, like this

sub ::btnCancel_Click {

I don't know if that's the right way, or the best way, but it works for me.


/J

Replies are listed 'Best First'.
Re: Re: Using Win32::GUI in a package
by Nitrox (Chaplain) on Dec 15, 2002 at 19:13 UTC
    I don't know if that's the right way, or the best way, but it works for me

    And it works for me too, thanks much for a solution jplindstrom!

    -Nitrox