<doc>
  <legacy_id>1788</legacy_id>
  <name>lockScreen</name>
  <type>property</type>
  <syntax>
    <example>set the lockScreen to {true | false}</example>
  </syntax>
  <library></library>
  <objects>
    <global/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Appearance &amp; Positioning</category>
  </classification>
  <references>
    <command tag="show cards">show cards Command</command>
    <command tag="unlock screen">unlock screen Command</command>
    <property tag="lockCursor">lockCursor Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Specifies whether changes to a <object tag="stack">stack</object> appear on the screen.</summary>
  <examples>
    <example>set the lockScreen to (not the lockScreen)</example>
  </examples>
  <description>
    <p>Use the <b>lockScreen</b> <glossary tag="property">property</glossary> to control when changes to the appearance of <glossary tag="object">objects</glossary> appear to the user, or to speed up actions that change several <glossary tag="object">objects</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>lockScreen</b> is true or false.</p><p/><p>By default, the <b>lockScreen</b> <glossary tag="property">property</glossary> is set to false. It is <command tag="reset">reset</command> to false when no <glossary tag="handler">handlers</glossary> are <glossary tag="execute">executing</glossary>.</p><p/><p><b>Comments:</b></p><p>If the <b>lockScreen</b> <glossary tag="property">property</glossary> is set to true, <glossary tag="statement">statements</glossary> that affect the appearance of the <glossary tag="stack window">stack windows</glossary>--such as opening or closing a <object tag="stack">stack</object>, going to another <keyword tag="card">card</keyword>, or changing <property tag="properties">properties</property> of an <glossary tag="object">object</glossary>--are not shown on the screen until the <b>lockScreen</b> is set back to false.</p><p/><p>If the <b>lockScreen</b> is false, all changes are displayed immediately.</p><p/><p>Setting the <b>lockScreen</b> to true also speeds up <glossary tag="handler">handlers</glossary> that affect the screen appearance. Since LiveCode does not need to take time <glossary tag="redraw">redrawing</glossary> its windows when the <b>lockScreen</b> is true, a <glossary tag="handler">handler</glossary> that visits several <glossary tag="card">cards</glossary> in a row or changes several <glossary tag="object">objects</glossary> runs faster if the <b>lockScreen</b> <glossary tag="property">property</glossary> is set to true while the changes are made.</p><p/><p>The <b>lockScreen</b> <glossary tag="property">property</glossary> is automatically set to false when a <command tag="palette">palette</command>, <command tag="modeless">modeless</command>, or <command tag="modal">modal</command> <object tag="stack">stack</object> is opened, even if a <glossary tag="handler">handler</glossary> is still running.</p><p/><p><code/><img src="202653"/> <b>Important!</b><code/> Open <function tag="stacks">stacks</function> cannot be brought to the front (using the <command tag="go">go</command> or <command tag="topLevel">topLevel</command> <glossary tag="command">command</glossary>) while the <b>lockScreen</b> is true.</p><p/><p>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:</p><p/><p><code>  on mouseUp</code></p><p><code>    lock screen    </code><code><i>-- first lock</i></code></p><p><code>    drawStuff      </code><code><i>-- gets locked again and unlocked in drawStuff</i></code></p><p><code>    show image "Sprite"</code></p><p><code>    unlock screen  </code><code><i>-- now unlocked - 2 locks balanced by 2 unlocks</i></code></p><p><code>  end mouseUp</code></p><p/><p><code>  on drawStuff</code></p><p><code>    lock screen    </code><code><i>-- screen now locked twice</i></code></p><p><code>    show field "Notify"</code></p><p><code>    unlock screen  </code><code><i>-- not unlocked yet - locked twice, unlocked once</i></code></p><p><code>  end drawStuff</code></p><p/><p><code/><b>Note:</b><code/> When using <glossary tag="debugger">script debug mode</glossary>, the screen cannot be locked and the setting of the <b>lockScreen</b> <glossary tag="property">property</glossary> has no effect.</p>
  </description>
</doc>