lock screen / unlock screen counter

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
SteveTX
Posts: 170
Joined: Sun Jan 17, 2010 9:00 pm

lock screen / unlock screen counter

Post by SteveTX » Tue Jul 16, 2013 3:08 am

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 

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: lock screen / unlock screen counter

Post by dunbarx » Tue Jul 16, 2013 5:19 pm

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

Post Reply