Slow screen lock/unlock

Malte Brill revolution at derbrill.de
Thu Mar 17 04:58:43 EST 2005


Hi Michael,

[snip]
  Here is my test script that takes 2680 milliseconds to run:
[/snip]

970 on my g4-400 X.2.6

But I think that test doesn´t match the problem. I guess you wouldn´t 
want to refresh the screen inside a repeat loop and you didn´t do it in 
your original script.

The slow screen update you see is indeed a quartz rendering issue. If 
you add the line

wait 0 with messages

  in your original script between lock screen and unlock screen it 
speeds up.

[snip]
...and before someone asks, no, the slowness is not related to
polling the mouse: commenting out that line doesn't change the update
rates.
[/snip]

I´m seeing it speeding up if I remove the if statement, but then there 
is no good way of getting out of the loop.Have you thought about using 
timers?

on mouseUp
    if the flag of me is empty then set the flag of me to -1
    set the flag of me to the flag of me*-1
    set the l of me to the left of grc 1
    set the w of me to the width of grc 1
    set the t of me to the top of grc 1
    set the h of me to the height of grc 1
    if the flag of me=1 then animatePoints
  end mouseUp

  on animatePoints
      --make randomly placed points
      lock screen
      put empty into myPoints
      repeat 100
        put the l of me + random(the w of me) into x
        put the t of me + random(the h of me) into y
        put x,y & return after mypoints
      end repeat

      --display them

      wait 0 with messages
      set the points of grc 2 to myPoints
      unlock screen

      if the flag of me=1 then send animatePoints to me in 1 millisecond

end animatePoints

Cheers,

Malte


More information about the use-livecode mailing list