Asynchronous animations in LCB

Mark Waddingham mark at livecode.com
Tue May 10 05:19:29 EDT 2016


On 2016-05-10 10:56, David Bovill wrote:
> I'm contemplating doing some animations in a widget, and would like the
> animation to be non-blocking. How do you achieve that in LCB?

At the moment a widget can ask for a single shot callback 'timer' using:

    schedule timer in <seconds> seconds

A timer can be cancelled by using

    cancel timer

When a timer triggers the OnTimer handler of the widget is invoked.

This is sufficient to do simple animations, indeed the clock shows a 
good example of using it:

   
https://github.com/livecode/livecode/blob/develop/extensions/widgets/clock/clock.lcb

Hope this helps!

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list