Removing an old, cherished, yet pointless caveat "This documentation is
[supercollider.git] / Help / GUI / Cocoa-GUI / SCModalSheet.html
blob070ed6c7a54d77e2b9377c31f3002921a6e88fd9
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.35">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #001bec}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica; min-height: 17.0px}
16 p.p7 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; min-height: 12.0px}
17 p.p8 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica}
18 p.p9 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica; min-height: 14.0px}
19 p.p10 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica}
20 p.p11 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
21 p.p12 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ae1a19}
22 p.p13 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
23 span.s1 {font: 18.0px Helvetica}
24 span.s2 {color: #0043f5}
25 span.s3 {color: #000000}
26 span.s4 {text-decoration: underline}
27 span.s5 {color: #003cf7}
28 span.s6 {color: #004aeb}
29 span.s7 {color: #0016bd}
30 span.s8 {color: #606060}
31 span.s9 {color: #ae1a19}
32 span.Apple-tab-span {white-space:pre}
33 </style>
34 </head>
35 <body>
36 <p class="p1"><span class="s1"><b>SCModalSheet<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><b>a window modal version of SCWindow</b><span class="s1"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span></p>
37 <p class="p2"><br></p>
38 <p class="p1"><b>Inherits from: </b><a href="../../Core/Object.html"><span class="s2"><b>Object</b></span></a><b> : </b><a href="SCWindow.html"><span class="s2"><b>SCWindow</b></span></a><b> : SCAbstractModalWindow</b></p>
39 <p class="p3"><br></p>
40 <p class="p1">SCModalSheet is an window modal version of SCWindow. A sheet is an accessory window which is attached to a parent window. SCModalSheet blocks all other user input to its parent window until it is dismissed. It is thus useful for alerts, preference panels and other situations which should limit user input.</p>
41 <p class="p2"><br></p>
42 <p class="p4"><span class="s3"><b>See also:</b> <a href="SCWindow.html"><span class="s4">SCWindow</span></a>, <a href="SCModalWindow.html"><span class="s4">SCModalWindow</span></a></span></p>
43 <p class="p2"><br></p>
44 <p class="p5"><b>Dismissing Modal Sheets</b></p>
45 <p class="p2"><br></p>
46 <p class="p1">SCModalSheets have no close button. It is therefore very important that you add an SCButton or some other GUI widget to allow the user to dismiss the sheet. As an 'escape hatch' pressing the esc key will kill a sheet if it has focus (i.e. is foremost and selected).</p>
47 <p class="p2"><br></p>
48 <p class="p5"><b>Blocking and Multiple Sheets on the Same Window</b></p>
49 <p class="p6"><br></p>
50 <p class="p1">Each window can have only sheet attached to it at any given time. (You can however have sheets attached to sheets.) If you attempt to create more than one at the same time all but the first will fail. If needed, you can check parent window's <b>currentSheet</b> method to see if a sheet is running. This will return the current sheet if it exists, and nil otherwise. If one is running, you can add a <a href="../../Core/Kernel/Function.html"><span class="s5">Function</span></a> to its onClose in order to relaunch the additional sheet(s) if desired, or do any necessary testing.</p>
51 <p class="p2"><br></p>
52 <p class="p5"><b>Creation / Class Methods</b></p>
53 <p class="p7"><br></p>
54 <p class="p8"><b><span class="Apple-tab-span"> </span>*new (window, bounds, resizable, border, server, scroll)</b></p>
55 <p class="p9"><b><span class="Apple-tab-span"> </span></b></p>
56 <p class="p8"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>Creates a new SCModalSheet instance. You do not need to call <b>front</b> on it to make it visible.</p>
57 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>window </b>- An instance of <a href="SCWindow.html"><span class="s2">SCWindow</span></a> or one of its subclasses. This is the parent window to which the sheet will be attached.</p>
58 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>bounds</b> - A <a href="../../Geometry/Rect.html"><span class="s6">Rect</span></a> or <a href="../../Geometry/Point.html"><span class="s2">Point</span></a> specifying the size of the window.</p>
59 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>resizable</b> - A <a href="../../Core/Boolean.html"><span class="s6">Boolean</span></a> indicating whether this window can be resized by the user. The default is false.</p>
60 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>border</b> - A <a href="../../Core/Boolean.html"><span class="s6">Boolean</span></a> indicating whether this window has a border. Borderless windows have no title bar. The default is true.</p>
61 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>server</b> - This is a dummy argument which is here to provide compatibility with SwingOSC and has no effect. See <a href="../GUI-Tools/GUI.html"><span class="s6">GUI</span></a> for more details.</p>
62 <p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>scroll</b> - A <a href="../../Core/Boolean.html"><span class="s6">Boolean</span></a> indicating whether this window will add scrollers if its contents exceed its bounds. If this is set to true resize settings will be ignored for enclosed views. See <a href="SCScrollTopView.html"><span class="s6">SCScrollTopView</span></a>. The default is false.</p>
63 <p class="p7"><br></p>
64 <p class="p11"><b>Examples</b></p>
65 <p class="p3"><br></p>
66 <p class="p12">///// simple example</p>
67 <p class="p13">w = <span class="s7">SCWindow</span>.new(<span class="s8">"Parent"</span>).front; <span class="s9">// make a window</span></p>
68 <p class="p3"><br></p>
69 <p class="p13">(</p>
70 <p class="p12">// now attach a sheet</p>
71 <p class="p13">x = <span class="s7">SCModalSheet</span>.new(w, 380@70);</p>
72 <p class="p13"><span class="s7">SCButton</span>(x, <span class="s7">Rect</span>(20,20,340,30))</p>
73 <p class="p13"><span class="Apple-tab-span"> </span>.states_([</p>
74 <p class="p13"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s8">"Dismiss me"</span>, <span class="s7">Color</span>.black, <span class="s7">Color</span>.red]</p>
75 <p class="p13"><span class="Apple-tab-span"> </span>])</p>
76 <p class="p13"><span class="Apple-tab-span"> </span>.onClose_({<span class="s8">"Dismissed!"</span>.postln})</p>
77 <p class="p13"><span class="Apple-tab-span"> </span>.action_({ x.close });</p>
78 <p class="p13">)</p>
79 <p class="p3"><br></p>
80 <p class="p3"><br></p>
81 </body>
82 </html>