[Gambas-user] Bug with process events?
Jussi Lahtinen
jussi.lahtinen at ...626...
Tue Dec 10 14:19:33 CET 2013
Hmmm... not sure I understood correctly. Why then it doesn't fail every
time?
Anyway, what I'm really trying to do is raise event (when signal arises
from another program), but wait until the system is IDLE. Here is the IDLE
detection code:
Do
Exec ["xprintidle"] To sTmp
Sleep 0.25
Loop Until CLong(Trim$(sTmp)) > WaitIDLE Or bClosing = True
I don't know where to put it without causing problems. Also I don't know
any other proper IDLE detection method.
Jussi
On Tue, Dec 10, 2013 at 3:46 AM, Benoît Minisini <
gambas at ...1...> wrote:
> Le 08/12/2013 18:06, Jussi Lahtinen a écrit :
> > See attached project. If event is raised something corrupts/event is
> missed.
> >
> >
> > Jussi
> >
> >
>
> EXEC ... TO (and SHELL ... TO) calls the event loop, so by using it
> inside the "Something" event handler, you are calling the event loop
> recursively, and an inner Process_Read is called while the outer is not
> yet terminated.
>
> Just put a breakpoint on your "What went wrong" message and look at the
> stack backtrace.
>
> The first character is not yet added to Main.sWord, while all the inner
> Process_Read are called as the event is raised before, so that first
> character is missing when reaching the end test.
>
> Just put the Raise Something after adding the character to Main.sWord,
> for example.
>
> I can't help you more without knowing exactly what you want to achieve.
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
>
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list