Refactoring is your friend / moving from 6.x to 9.x
Paul Hibbert
paul at livecode.org
Wed Jan 2 03:17:00 EST 2019
Malte,
I think the info you were probably looking for is buried within the dictionary entry for the “lockScreen” Property, maybe this should be referenced a little better in the dictionary entries for “lock screen” and “unlock screen”, see below:
LiveCode keeps count of how many times the screen has been locked. You must balance each unlock with a lock; if you lock the screen twice and then unlock it once, the screen remains locked. For example, the following pair of handlers draws everything while the display is still locked:
on mouseUp
lock screen -- first lock
drawStuff -- gets locked again and unlocked in drawStuff
show image "Sprite"
unlock screen -- now unlocked - 2 locks balanced by 2 unlocks
end mouseUp
on drawStuff
lock screen -- screen now locked twice
show field "Notify"
unlock screen -- not unlocked yet - locked twice, unlocked once
end drawStuff
Paul
> On Dec 30, 2018, at 13:55, Malte Pfaff-Brill via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Hey Mark,
>
> At least it is behaviour that changed between engine releases. :-)
> Thinking of a counter here is a good way to describe the behaviour, however, it is not what is written in the dictionary.
>
>
> "unlock screen
>
> Sets the lockScreen property to false, updating the screen and displaying any changes made since the screen was locked.“
>
> If unlock screen sets a property, the expectation would be to take effect as soon as one unlock screen is issued, as a property can only have one state. Nesting is not described in the dictionary. Not that I can not live with the change, that is not my point
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list