|
From: Casey W. <wil...@nc...> - 2001-11-28 21:56:49
|
Ok, I figured out the variable thing...I was using an anonymous sub instead
of a regular sub ref in the Event function.
----- Original Message -----
From: "Casey Williams" <wil...@nc...>
To: <wxp...@li...>
Sent: Wednesday, November 28, 2001 3:33 PM
Subject: Re: [wxperl-users] How to kick off event functions while in a loop
> > > Hey guys,
> > > I've been seaching through the doc's for a way to fire off Events
> > even if I'm running a loop such as...
> > >
> > > foreach my $i (0..999999) {...}
> > >
> > > I've found the Yield() and SafeYield() functions. But those only
> > allow the GUI to be updated for interaction, but don't allow the
> > functions tied to the events to be called. At least, as far as I can
> > tell anyhow. Anyone have any advice?
> > The only "real" solution to your problem is to use threads; as an
>
> I was afraid of that. :( Are threads available in wxPerl? All I *really*
> need to do is toggle a variable by pressing a button to make the loop
stop.
>
> > ( ugly ) workaround you might use a wxTimer; using wxYield is _strongly_
> > discouraged because it can lead to unexpected reentrancy
> > problems ( of course there are cases where you can't do without ).
> > I never used it, so I can't tell if the handlers not being fired is
> > a wxPerl or a wxWindows problem ( will check ).
>
> Thanks again!
>
>
> _______________________________________________
> wxperl-users mailing list
> wxp...@li...
> https://lists.sourceforge.net/lists/listinfo/wxperl-users
>
|