<doc>
  <legacy_id>2369</legacy_id>
  <name>mode</name>
  <type>property</type>
  <syntax>
    <example>get the mode of <i>stack</i></example>
  </syntax>
  <library></library>
  <objects>
    <stack/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Windows &amp; Dialog Boxes</category>
  </classification>
  <references>
    <command tag="modeless">modeless Command</command>
    <command tag="drawer">drawer Command</command>
    <object tag="stack">stack Object</object>
    <property tag="cantModify">cantModify 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>Reports the type of window a <object tag="stack">stack</object> is displayed in.</summary>
  <examples>
    <example>if the mode of this stack &gt; 2 then topLevel this stack</example>
  </examples>
  <description>
    <p>Use the <b>mode</b> <glossary tag="property">property</glossary> to determine how the user can interact with the <object tag="stack">stack</object>.</p><p/><p><b>Value:</b></p><p>The <b>mode</b> of a <object tag="stack">stack</object> is an <keyword tag="integer">integer</keyword> between zero and 14.</p><p/><p>This property is read-only and cannot be set.</p><p/><p><b>Comments:</b></p><p>The <b>mode</b> of a <object tag="stack">stack</object> is one of the following numbers:</p><p/><p><code>0</code>: closed but loaded</p><p>The stack window is closed, but the stack is still in memory. A stack can have this <b>mode</b> if its <property tag="destroyStack">destroyStack</property> <glossary tag="property">property</glossary> is set to false and the stack has been opened, then closed.</p><p/><p><code>1</code>: editable window</p><p>The stack is open and displayed in an editable window. A stack has this <b>mode</b> if its <property tag="style">style</property> is "topLevel" or if it was opened with the <command tag="topLevel">topLevel</command> <glossary tag="command">command</glossary>.</p><p/><p><code>2</code>: non-editable window</p><p>The stack is open and displayed in a normal window, but is not editable.  A stack has this <b>mode</b> if its <property tag="style">style</property> is "topLevel" or if it was opened with the <command tag="topLevel">topLevel</command> <glossary tag="command">command</glossary>, and the <glossary tag="stack">stack's</glossary> <property tag="cantModify">cantModify</property> <glossary tag="property">property</glossary> is set to true.</p><p/><p><code>3</code>: modeless dialog</p><p>The stack is open and displayed as a modeless dialog box.  A stack has this <b>mode</b> if its <property tag="style">style</property> is "modeless" or if it was opened with the <command tag="modeless">modeless</command> command</p><p/><p><code>4</code>: palette</p><p>The stack is open and displayed as a palette.  A <object tag="stack">stack</object> has this <b>mode</b> if its <property tag="style">style</property> is "palette" or if it was opened with the <command tag="palette">palette</command> <glossary tag="command">command</glossary>.</p><p/><p><code>5</code>: modal dialog</p><p>The stack is open and displayed as a modal dialog box.  A stack has this <b>mode</b> if its <property tag="style">style</property> is "modal" or if it was opened with the <command tag="modal">modal</command> <glossary tag="command">command</glossary>.</p><p/><p><code>6</code>: sheet</p><p>The stack is open and displayed as a sheet.  A stack has this <b>mode</b> if it was opened with the <command tag="sheet">sheet</command> <glossary tag="command">command</glossary>. (If the <command tag="sheet">sheet</command> <glossary tag="command">command</glossary> was used on a <function tag="platform">platform</function> other than <glossary tag="OS X">OS X</glossary>, the <object tag="stack">stack</object> is displayed as a <glossary tag="modal dialog box">modal dialog box</glossary> instead of a <command tag="sheet">sheet</command>. In this case, its <b>mode</b> is 5.)</p><p/><p><code>7</code>: pulldown stack menu</p><p>The stack is open and displayed as a pulldown menu.  A stack has this <b>mode</b> if it was opened with the <command tag="pulldown">pulldown</command> <glossary tag="command">command</glossary>, or if it is the menuStack of a <keyword tag="button">button</keyword> whose <property tag="style">style</property> is set to "menu" and whose <property tag="menuMode">menuMode</property> is set to<code> pulldown</code>.</p><p/><p><code>8</code>: popup stack menu</p><p>The stack is open and displayed as a <glossary tag="popup menu">popup menu</glossary>.  A <object tag="stack">stack</object> has this <b>mode</b> if it was opened with the <command tag="popup">popup</command> <glossary tag="command">command</glossary>, or if it is the menuStack of a <keyword tag="button">button</keyword> whose <property tag="style">style</property> is set to "menu" and whose <property tag="menuMode">menuMode</property> is set to "popup".</p><p/><p><code>9</code>: option stack menu</p><p>The stack is open and displayed as an option menu.  A stack has this <b>mode</b> if it is the menuStack of a <keyword tag="button">button</keyword> whose <property tag="style">style</property> is set to "menu" and whose <property tag="menuMode">menuMode</property> is set to "option".</p><p/><p><code>10</code>: submenu in a stack menu</p><p>The stack is open and displayed as a cascading menu.  A stack has this <b>mode</b> if it is the menuStack of a <keyword tag="button">button</keyword> whose <property tag="style">style</property> is set to "menu" and whose <property tag="menuMode">menuMode</property> is set to "cascade".</p><p/><p><code>11</code>: combo box stack menu</p><p>The stack is open and displayed as a combo box.  A stack has this <b>mode</b> if it is the menuStack of a <keyword tag="button">button</keyword> whose <property tag="style">style</property> is set to "menu" and whose <property tag="menuMode">menuMode</property> is set to "comboBox".</p><p/><p><code>12</code>: collapsed</p><p>The stack is open but has been collapsed (Mac OS), iconified (Unix), or minimized (Windows).</p><p/><p><code>13</code>: drawer</p><p>The stack is open as a drawer beside another window. A stack has this <b>mode</b> if it was opened with the <command tag="drawer">drawer</command> <glossary tag="command">command</glossary>.</p><p/><p>If two stacks with different modes are open, the stack whose <b>mode</b> <glossary tag="property">property</glossary> is lower takes precedence when determining which <object tag="stack">stack</object> is the <function tag="topStack">topStack</function>. This means, for example, that menu items (such as Object menu<img src="202656"/>Stack Properties<important/>) that act on the current s may not be able to operate correctly with a stack whose cantModify<b/> is set to true (and whose <b>mode</b> is therefore 2) as long as another, modifiable <a/>s (<b>mode</b> equal to 1) is open.</p>
  </description>
</doc>