Weird Idle behavior

Chris Carroll-Davis chris at carroll-davis.co.uk
Tue Mar 28 04:17:24 EST 2006


Thanks for the comments Jaqueline.

Yep, I do appreciate that it's more efficient to use "send" * , but  
the trouble is I want the timer to animate smoothly, not lurch once a  
second.

I have the thing working fine now without using the dreaded idle.  I  
know it's not the best solution, but I'm using two "flavours" of the  
updateTimer handler.  One that includes a call to send update in 6  
ticks (so I get 10 fps) that replaces idle. Another flavour (exactly  
the same but without call for update) updates the timer during tight  
loops (e.g. during mouse drag of objects).

Thanks again.

Chris

* Am holding copy of complete adventures of Rocky and Bulwinkle in  
right hand and hereby swear to *never* use idle again in my whole  
life. Ever. OK?

:-)


On 27 Mar 2006, at 22:17, J. Landman Gay wrote:

> Chris Carroll-Davis wrote:
>> Hello folks -
>> here's a weird one...  I'm updating a timer on idle:
>> On idle
>>   global StartTicks
>>   if StartTicks = "" then exit idle
>>   updateTimer
>>   wait 1 millisecond with messages -- attempt at kludge!
>> end idle
>> which just draws an arc graphic to give visual feedback
>> On updateTimer
>>   global StartTicks, timeLimit
>>   If StartTicks = "" then exit UpdateTimer
>>   put 180+(180/(timeLimit * 60) * (the ticks - StartTicks)) into a
>>   set the startangle of grc "timer" to a
>>   if a >= 360 and StartTicks <> "" then
>>     TimesUp
>>     exit updateTimer
>>   end if
>> end updateTimer
>> This goes along fine, timing out after the timelimit ... except  
>> that  it doesn't update the display!!    If I call "updateTimer"  
>> from a  repeat loop, it works fine.  Has anyone come across this  
>> before?  Anyone got a workaround!?
>
> Works okay here, after I set the arcAngle to something other than a  
> circle.
>
> This is really a job for the "send" command though. If you send the  
> message only once per second you won't get all that extra stuff in  
> the pendingmessages.
>
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the Use-livecode mailing list