Ok, I have the indexing of my offline wikipedia project going, but I noticed one issue while continuing to work on that bit. That is that the interface freezes up while this process takes place. You can't move the stack/window at all during this time, plus, if you open other windows on top of it, the interface turns white and does not refresh, except for objects that I am updating during this process.
Is there any way to keep this from happening?
Thanks,
~Garrett
Freezing up interface during CPU intense operations...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Freezing up interface during CPU intense operations...
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
The 'best' way is to chop up the data processing into chunks that are executed using a 'send in time' construct - this way, your user interface won't be blocked and you could even add a 'Cancel' button.
Another method is to sprinkle your code with 'wait 0 milliseconds' as this gives the engine 'breathing room' to refresh the screen inside tight loops - but your user still won't be able to cancel out of the operation.
Something in between these two methods is putting 'wait 0 milliseconds with messages' in strategic spots of your processing code: this allows the engine to temporarily halt the execution of your script, handle the next user input event and then resume the execution of your script.
It is probably a good idea to show a progress indicator if possible while a long-running process is busy; and if you're going to allow user interaction during the process, then disable certain controls to prevent the user from starting multiple tasks that may interfere with one another.
Jan Schenkel.
Another method is to sprinkle your code with 'wait 0 milliseconds' as this gives the engine 'breathing room' to refresh the screen inside tight loops - but your user still won't be able to cancel out of the operation.
Something in between these two methods is putting 'wait 0 milliseconds with messages' in strategic spots of your processing code: this allows the engine to temporarily halt the execution of your script, handle the next user input event and then resume the execution of your script.
It is probably a good idea to show a progress indicator if possible while a long-running process is busy; and if you're going to allow user interaction during the process, then disable certain controls to prevent the user from starting multiple tasks that may interfere with one another.
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com