Include a header file required for build on mac 10.4
[supercollider.git] / Help / GUI / guicrucial / gui.html
blobfe3d868d97522f1879aa31c43f10200254b2add5
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.54">
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: 10.0px Monaco}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #001ca1}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #782514; min-height: 15.0px}
18 p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
19 span.s1 {font: 18.0px Helvetica}
20 span.s2 {color: #001ca1}
21 span.s3 {color: #4d4d4d}
22 span.s4 {font: 12.0px Helvetica}
23 span.s5 {color: #000000}
24 span.Apple-tab-span {white-space:pre}
25 </style>
26 </head>
27 <body>
28 <p class="p1"><span class="s1"><b>gui</b></span><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>make a graphical user interface for an object</b></p>
29 <p class="p2"><br></p>
30 <p class="p1">.gui is a common interface convention that creates a graphical user interface for the object<span class="Apple-converted-space"> </span></p>
31 <p class="p2"><br></p>
32 <p class="p3"><span class="s2">nil</span>.gui;</p>
33 <p class="p3"><span class="s3">"2"</span>.gui;</p>
34 <p class="p3">2.gui;</p>
35 <p class="p3">[1,<span class="s2">nil</span>,<span class="s3">"tree"</span>].gui;</p>
36 <p class="p4"><br></p>
37 <p class="p4"><br></p>
38 <p class="p1"><b>gui(parent,bounds)</b></p>
39 <p class="p4"><br></p>
40 <p class="p1"><b>parent</b> -</p>
41 <p class="p5"><span class="Apple-tab-span"> </span>a Window,</p>
42 <p class="p5"><span class="Apple-tab-span"> </span>a FlowView</p>
43 <p class="p5"><span class="Apple-tab-span"> </span>CompositeVIew</p>
44 <p class="p5"><span class="Apple-tab-span"> </span>HLayoutView</p>
45 <p class="p5"><span class="Apple-tab-span"> </span>VLayoutView</p>
46 <p class="p5"><span class="Apple-tab-span"> </span>nil (will create a window with a FlowView)<span class="Apple-converted-space"> </span></p>
47 <p class="p2"><b></b><br></p>
48 <p class="p1"><b>bounds</b> -</p>
49 <p class="p5"><span class="Apple-tab-span"> </span>anything that responds to asRect:</p>
50 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Nil - the gui will use its own default size</p>
51 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Point - width @ height</p>
52 <p class="p2"><br></p>
53 <p class="p1"><span class="Apple-tab-span"> </span>Usually the bounds are not specified.<span class="Apple-converted-space">  </span>The object's gui class first adds a container,</p>
54 <p class="p1"><span class="Apple-tab-span"> </span>lays its things inside that container and then shrinks the container to fit it.</p>
55 <p class="p1"><span class="Apple-tab-span"> </span>If you specify a bounds, the container will be set to that size and will stay that way.</p>
56 <p class="p4"><br></p>
57 <p class="p1"><b>Add yourself to a parent view (window)</b></p>
58 <p class="p5">(</p>
59 <p class="p5"><span class="Apple-tab-span"> </span>f = <span class="s2">FlowView</span>.new;</p>
60 <p class="p5"><span class="Apple-tab-span"> </span><span class="s2">nil</span>.gui(f);</p>
61 <p class="p5"><span class="Apple-tab-span"> </span><span class="s3">"2"</span>.gui(f);</p>
62 <p class="p5"><span class="Apple-tab-span"> </span>2.gui(f);</p>
63 <p class="p5">)</p>
64 <p class="p4"><br></p>
65 <p class="p4"><br></p>
66 <p class="p1">Each class can specify an associated guiClass, which is a subclass of ObjectGui.</p>
67 <p class="p1">If none is specified then ObjectGui will create the simplest of guis.</p>
68 <p class="p2"><br></p>
69 <p class="p1">Examples specifying guiClass:</p>
70 <p class="p2"><br></p>
71 <p class="p5"><span class="s4"><span class="Apple-tab-span"> </span></span><span class="s2">Object</span>-guiClass {<span class="Apple-converted-space">  </span>^<span class="s2">ObjectGui</span> }</p>
72 <p class="p6"><span class="s5"><span class="Apple-tab-span"> </span></span>AbstractPlayer<span class="s5">-guiClass { ^</span>AbstractPlayerGui<span class="s5"> }</span></p>
73 <p class="p5"><span class="Apple-tab-span"> </span><span class="s2">Patch</span>-guiClass { ^<span class="s2">PatchGui</span> }</p>
74 <p class="p7"><br></p>
75 <p class="p1">For any class where it is appropriate, a separate gui class is implemented, usually inheriting much of its behavior from the gui class of the superclass.</p>
76 <p class="p8"><br></p>
77 <p class="p9">see also [ObjectGui]</p>
78 <p class="p7"><br></p>
79 </body>
80 </html>