Screen refresh

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
David_USA
Posts: 8
Joined: Sun Jun 29, 2008 6:30 pm
Contact:

Screen refresh

Post by David_USA » Sun Dec 28, 2008 4:28 am

Question: If Revolution is running a process and sending a visual update of the process via a put into a field, should the screen refresh and update stop if you navigate away from Revolution to another application.?

I am using the stack on a windows Vista Platform
While my stack is running a long process I navigate away. When I return the screen is stuck where I left it. It is not updating until the entire process is finished. When the process is finished I get my process completed answer dialog. At this time everything works great again.

I am in need of this not happening so that I can monitor progress as needed.

David J. Lamp

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Sun Dec 28, 2008 9:01 am

Revolution is single-threaded, so all event handling blocks the user interface from handling input until the task is done. You can indeed update the user interface but at times in 'tight' loops, the engine is strugging to refresh the display.
One way around this is to insert 'wait 0 milliseconds' at the end of every cycle after you update the progress. This seems to give the engine 'breathing room' to update the user interface. Naturally, it does slow things down a bit, so you may only want to do this every 20th iteration.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

David_USA
Posts: 8
Joined: Sun Jun 29, 2008 6:30 pm
Contact:

Perfect Fix

Post by David_USA » Sun Dec 28, 2008 5:59 pm

Thank you for this insight.

I have implemented your suggestion and it worked great.

Best Regards,

David J. Lamp

Post Reply