Req: spinning progress indicator a la OS X

Ken Ray kray at sonsothunder.com
Fri Sep 26 11:09:36 EDT 2008



> Now that I have one I'm finding the hard part is working out the mod
> factors so it changes frames smoothly and consistently throughout
> various stages of the process.  When using the OS API directly is spawns
> a separate thread, so the pace of the movement is unaffected by whatever
> the app is actively doing.  But in Rev, this is a bit trickier....

I'm not using an animated GIF but individual images that are assigned as
icons to a button in rotation, but I'm doing a "send in time" every 50
milliseconds, and it seems to work out pretty smoothly for most operations
(but then again, YMMV).

The only "true" way to spawn a process in Rev (AFAIK) is to actually have a
separate "mini-standalone" that is launched and controlled by a main
standalone. Not pretty, but for true asynchronous operation, it may be worth
the trouble of the extra size/complexity.

This is one of those times where it would be great if we could do something
like:

global gSpinnerThread
on StartSpinner
  create thread
  put the long id of it into gSpinnerThread
  send "StartIt" to me using thread gSpinnerThread
end StartSpinner

on StartIt
  -- whatever you need to do to start the spinner (exchange icons in a
  -- button, start playing an animated GIF, etc.)
end StartIt

on StopSpinner
  send "StopIt" to me using thread gSpinnerThread
  delete thread gSpinnerThread
end StopSpinner

on StopIt
  -- whatever you need to do to stop the spinner
end StopIt

----

(Of course if we were going down the "thread" road, I'd probably use a
different syntax with "newThread", "openThread", "closeThread", etc. )

Anyway, you get the picture...

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list