Lock Screen on preOpenCard

Kay C Lan lan.kc.macmail at gmail.com
Thu Feb 13 20:54:39 EST 2014


On Fri, Feb 14, 2014 at 12:19 AM, Ender Nafi Elekcioglu <endernafi at keehuna
.com> wrote:

>
> The lock/unlock of the second card's preOpenCard handler is redundant,
> isn't it?
>
> For small or relatively simple stacks keeping track of lock/unlock pairs
is fairly straight forward. Once you get a little more complex you can run
the risk of piling up nested lock screen and then not having the visual
effect you desire when you unlock screen. I've found the easiest solution
is to:

if the lockScreen is false then lock screen

If you only ever use this then their will be no nested locked screens, so
you are only ever one command away from unlocking the screen.

if the lockScreen is true then unlock screen [with visual effect]

Then you don't have to bother about keeping track of pairs and can rest
easy at nights knowing that if left to the engine it only has to unlock
once when it goes idle - rather than having to wait a millisecond longer if
you had dozens of nested lock screen piled up.



More information about the use-livecode mailing list