Page 1 of 1

lock screen / unlock screen counter

Posted: Tue Jul 16, 2013 3:08 am
by SteveTX
LiveCode keeps track of lock (+1) and unlock events (-1), and if the integer is positive, the screen is locked. Does it keep track of integers less than 0? If I am already in an unlocked state, and I unlock again and the lock back, am I still unlocked (integers less than 0) or is it locked? The answer to this question needs to go in the dictionary.

ex:

Code: Select all

command doIt
  lock screen
   answer "hello world!"
  unlock screen
  doThat
end doIt

command doThat
  unlock screen
   answer "goodbye world!"
  lock screen
end doThat 

Re: lock screen / unlock screen counter

Posted: Tue Jul 16, 2013 5:19 pm
by dunbarx
Locks are queued, but an excess of unlocks are ignored

Code: Select all

on mouseUp
   unlock screen
   unlock screen
   unlock screen
    lock screen
   doStuff
end mouseUp
The screen is locked when you doStuff.

Craig Newman