|
From: Marcus <li...@wo...> - 2001-11-04 13:53:00
|
On 04.11.01 at 06:28 Mark Wilkinson wrote:
>The real question is this: how do you get your variables into your
widget
>event
>control subroutines? e.g. the code below:
>
>use strict;
>my $x = 1;
>
>sub Button_Click {
> ++$x
>}
Well, I think you need to declare subs as:
sub main::Button_Click {
or at the latest when you have an external widget, your events won't be
processed. I just figured that one out again, or should I say I
remembered what I'd read in the manual :-)
and for your $x, call it $main::x.
I've been wrestling with this stuff too. I just wrote a remote FTP
directory selector which sits in a separate module and in order to set
the Textfield I have to say
$main::win->RemoteDirectoryTextField->Text("...");
You can't use a return value because that gets sent back to
Win32::GUI's main loop and that wants to receive 0,1, or -1 only. I
think that's correct isn't it?
Marcus
|