[Gambas-user] Re: DoEvents
Benoit Minisini
gambas at ...1...
Tue Dec 14 17:53:40 CET 2004
On Wednesday 08 December 2004 14:30, Christian Faure wrote:
> El Miércoles, 8 de Diciembre de 2004 06:48, Benoit Minisini escribió:
> > On Tuesday 07 December 2004 19:50, LB Audio wrote:
> > > Please DoEvents in Gambas.
> >
> > An X11 application can't block other X11 applications - except that there
> > is an X instruction that can lock the X server.
> >
> > The WAIT instruction of Gambas does the same thing than DoEvents on
> > Windows NT{4,5,5.1}: it calls the event loop so that event are managed.
> >
> > This call is recursive, so it can be dangerous: you can create an
> > infinite recursion of event handler calls.
> >
> > But the WAIT Gambas instruction is safer than its VB counterparts, as it
> > does not handle input events (mouse & keyboard). Generally, you use WAIT
> > only for letting the program refresh its GUI.
> >
> > Regards,
>
> In somes case, a Cancel button is necesary to cancel a big process,
> Is posible to create another api or modify WAIT to handle input events?
>
> Regards
>
I will patch the WAIT function this way:
WAIT alone does not handle input events, and WAIT with a duration handle them.
So by doing a 'WAIT 0.1' regularly in your process, you will be able to catch
when the 'Cancel button is pressed.
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list