[Gambas-user] Freeze mouse input for a second

tobias tobiasboe1 at ...20...
Mon Feb 6 15:28:23 CET 2012


hi,

> Hi All,
> 
> I've made a small game called Memory for my kids in Gambas 2.22.
> 
> You click one picture and make it visible, click the other and make it
> visible, when matching pictures, disable both pictures, when not
> matching make invisible again after 1 sec.
> 
> This all works perfectly (at least for me). When the kids test it they
> click one picture and the other, then the wait of 1 sec shows them both
> pictures for a second. So far so good.
> 
> But what do kids do, they click another picture before the WAIT 1.0 is
> finished and the application suddenly has 3 pictures turned instead of
> two. And this is where trouble starts :-)
> 
> My question: Is there a way in Gambas to freeze the mouse input?
> So when two pictures are selected and WAIT 1.0 is run, I would like evry
> click on the mouse to be ignored for that short period. That would solve
> the whole issue.
> 
> Been looking in documentation and google for quite a while now, but no
> answer found so far. Hope one of you has an answer.
> 
> Thanks,
> 
> Willy
> 
> 

well, i remember that it was possible to
INC Application.Busy
to disable actions on the form (or something) but i would tend to use 
the SLEEP instruction just as you use WAIT. WAIT according to the docs 
reenters the event loop and since you do not want events to be 
acknowledged but "freeze" the program SLEEP may match the need exactly.

regards,
tobi




More information about the User mailing list