[Gambas-user] How to interrupt a loop ?

serge bouc serge.bouc at ...402...
Thu Sep 28 14:02:47 CEST 2006


Hello everybody,

My problem is now the following : I have a form in Gambas,
with a button called "compute". When this button is clicked,
the program executes "compute_click()", which is essentially
a loop where a computation is done, which may be rather long,
depending on some other parameters of the program.

So I would like to have the possibility of interrupting this computation,
with a click, or a keypress, or whatever. But it seems that once
the computation loop has started, all the events I could use
are inactive (the mouse clicks are no longer seen, nor the keys
pressed, even the timer events), until the loop has terminated.

I imagine I am missing something here. I have tried to define
a new EVENT I could RAISE at some point in the loop, but
I didn't succeed, and I confess I don't understand Gambas
documentation on this subject.

So the only thing I can do at the moment is stop the program by
closing its window, and waiting for KDE to kill the application.
Of course, this is definitely not a good solution... :-(

Thanks for any suggestion.
Serge.






More information about the User mailing list