Refactoring is your friend / moving from 6.x to 9.x
paul at livecode.org
Wed Jan 2 09:17:00 CET 2019
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:
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
lock screen -- screen now locked twice
show field "Notify"
unlock screen -- not unlocked yet - locked twice, unlocked once
> 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:
More information about the use-livecode