Req: spinning progress indicator a la OS X

Devin Asay devin_asay at byu.edu
Fri Sep 26 13:08:56 EDT 2008


On Sep 25, 2008, at 1:31 PM, Richard Gaskin wrote:

> I'm looking for a freeware animated GIF file of an OS X-style spinning
> progress indicator, such as you see when booting the Mac.
>
> Anyone know where I can find one?

Wow! Lots of great references in this thread. But for the sake of  
completeness, and sheer, 100%-Transcript-coolness, here is a re-post  
of a set of handlers posted a few years ago by Wouter. I assume he  
wouldn't mind my re-posting it:

========= Begin paste =========

From: Wouter <wouter.abraham at pi.be>
Date: July 16, 2004 12:23:43 PM MDT
To: use-revolution at lists.runrev.com
Subject: Remember the NSProgressIndicator OS X?
Reply-To: How to use Revolution <use-revolution at lists.runrev.com>

For those who like to play,
paste the following starter script into a button:

constant cStar = "grc runningStar"
local aPoints,runState,Cp

on mouseUp
   if runstate  = 0 then set the label of me to "Stop Running"
   else set the label of me to ""
   if runstate <> 0  then
     stopLines
     exit to top
   end if
   if there is no grp "runningStar" then goCreateSome
   put the right of me + 20,item 2 of the loc of me into CP
   put 9 into runState
   delete var aPoints
   prepArray  11,7
   startLines
   runLines
end mouseUp

on stopLines
   repeat with i = 7 down to 1
     put cStar & i into tStar
     hide tSTar
     wait 50 millisecs
   end repeat
   put 0 into runState
end stopLines

on startLines
   repeat with i = 7 down to 1
     put cStar & i into tStar
     put runstate - i  + 1 into x
     if x <= 0 then add 12 to x
     set the points of tSTar to aPoints[x]
     show tSTar
     wait 70 millisecs
   end repeat
end startLines

on runLines
   if runState <> 0 then
     repeat with i = 1 to 7
       put cStar & i into tStar
       put runstate - i  + 1 into x
       if x <= 0 then add 12 to x
       set the points of tSTar to aPoints[x]
     end repeat
     if runstate = 12 then put 1 into runstate
     else add 1 to runState
     send "runLines" to me in 70 millisecs
   end if
end runLines

on prepArray  tG,tK
   put item 1 of Cp into tX
   put item 2 of Cp into tY
   put (2 * pi / 12) into sRad
   repeat with i = 1 to 12
     put trunc(tG * cos (sRad * i)) + tX into a
     put trunc(tG * sin (sRad * i)) + tY into b
     put trunc(tK * cos (sRad * i)) + tX into c
     put trunc(tK * sin (sRad * i)) + tY into d
     put a,b & cr & c,d into aPoints[i]
   end repeat
end prepArray

### for those who like 1 liners,
###beware of the linewrap
put trunc(tG * cos (sRad * i)) + tX,trunc(tG * sin (sRad * i)) + tY &  
cr & trunc(tK * cos (sRad * i)) + tX,trunc(tK * sin (sRad * i)) + tY   
into aPoints[i]
###

on goCreateSome
   put 110 into tX
   repeat with i = 1 to 7
     put tX,tX,tX into tColors[i]
     add 20 to tX
   end repeat
   repeat with i = 1 to 7
     put cStar&i into tStar
     do "create invisible" && tStar
     set the style of tStar to polygon
     set the linesize of tStar to 2
     set the colors of tStar to tColors[i]
     put the name of tStar && "and "  after tList
   end repeat
   delete last word of tList
   do "group" && tList
   set the name of last grp to "runningStar"
   choose browse tool
end goCreateSome

===========End paste==========

Have fun.
Greetings,
WA

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution



Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list