This file is indexed.

/usr/share/mozart/doc/demo/node24.html is in mozart-doc 1.4.0-8ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Root functor: Bounce.oz</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="bounce.html">- Up -</A></TD></TR></TABLE><DIV class="unnumbered" id="code.bounce"><H3><A name="code.bounce">Root functor: <CODE>Bounce.oz</CODE></A></H3><P class="margin"><A href="Bounce.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN>&nbsp;<BR>&nbsp;<BR><SPAN class="keyword">import</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Tk<BR>&nbsp;&nbsp;&nbsp;Application(exit)<BR>&nbsp;<BR><SPAN class="keyword">define</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;CanvasWidth&nbsp;&nbsp;=&nbsp;400<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;CanvasHeight&nbsp;=&nbsp;400<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;BallRadius&nbsp;&nbsp;&nbsp;=&nbsp;50<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;XDelta&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;5<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;YDelta&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;5<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;Gravity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;3<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;Fraction&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;0<SPAN class="keyword">.</SPAN>9<BR>&nbsp;&nbsp;&nbsp;RepeatTime&nbsp;&nbsp;&nbsp;=&nbsp;100<BR>&nbsp;&nbsp;&nbsp;Mouth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;30<BR>&nbsp;&nbsp;&nbsp;MouthDelta&nbsp;&nbsp;&nbsp;=&nbsp;5<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;BackColor&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;<SPAN class="string">'#fffff0'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;BallColors&nbsp;&nbsp;&nbsp;=&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;Tk<SPAN class="keyword">.</SPAN>isColor&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;red&nbsp;&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;blue&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;yellow&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;green&nbsp;&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plum&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;cyan&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;tan&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;bisque&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;BallColors<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;black&nbsp;<SPAN class="keyword">|</SPAN>&nbsp;BallColors<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">class</SPAN>&nbsp;<SPAN class="type">Ball</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">from</SPAN><SPAN class="type">&nbsp;Time.repeat&nbsp;Tk.canvasTag</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">prop</SPAN>&nbsp;final<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">attr</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xd:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;XDelta<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yd:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YDelta<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouth:&nbsp;&nbsp;Mouth<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">~</SPAN>MouthDelta<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">init</SPAN>(X&nbsp;Y&nbsp;Canvas&nbsp;Color)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tk<SPAN class="keyword">.</SPAN>canvasTag<SPAN class="keyword">,</SPAN>tkInit(parent:Canvas)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Canvas&nbsp;tk(crea&nbsp;arc&nbsp;X&nbsp;Y&nbsp;X<SPAN class="keyword">+</SPAN>BallRadius&nbsp;Y<SPAN class="keyword">+</SPAN>BallRadius<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fill:Color&nbsp;start:30&nbsp;extent:300&nbsp;tag:<SPAN class="keyword">self</SPAN>)}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;X<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;Y<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time<SPAN class="keyword">.</SPAN>repeat<SPAN class="keyword">,</SPAN>&nbsp;setRepAll(action:bounce&nbsp;delay:RepeatTime)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">thread</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">try</SPAN>&nbsp;{<SPAN class="keyword">self</SPAN>&nbsp;go}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">catch</SPAN>&nbsp;_&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="keyword">skip</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">bounce</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">increment&nbsp;@x&nbsp;and&nbsp;@d<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>x&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>xd<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>x&nbsp;<SPAN class="keyword">=&lt;</SPAN>&nbsp;0<SPAN class="keyword">.</SPAN>0&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;0<SPAN class="keyword">.</SPAN>0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xd&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">~@</SPAN>xd<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>x<SPAN class="keyword">&gt;=</SPAN>CanvasWidth<SPAN class="keyword">-</SPAN>BallRadius&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;CanvasWidth<SPAN class="keyword">-</SPAN>BallRadius<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xd&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">~@</SPAN>xd<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">increment&nbsp;@y&nbsp;and&nbsp;@yd<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>y&nbsp;<SPAN class="keyword">-</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>yd<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yd&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>yd&nbsp;<SPAN class="keyword">-</SPAN>&nbsp;Gravity<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>y<SPAN class="keyword">&gt;=</SPAN>CanvasHeight<SPAN class="keyword">-</SPAN>BallRadius&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;CanvasHeight<SPAN class="keyword">-</SPAN>BallRadius<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yd&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;Fraction&nbsp;<SPAN class="keyword">*</SPAN>&nbsp;<SPAN class="keyword">~@</SPAN>yd<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tk<SPAN class="keyword">.</SPAN>canvasTag<SPAN class="keyword">,</SPAN>tk(coords&nbsp;<SPAN class="keyword">@</SPAN>x&nbsp;<SPAN class="keyword">@</SPAN>y&nbsp;<SPAN class="keyword">@</SPAN>x<SPAN class="keyword">+</SPAN>BallRadius&nbsp;<SPAN class="keyword">@</SPAN>y<SPAN class="keyword">+</SPAN>BallRadius)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">set&nbsp;the&nbsp;new&nbsp;mouth<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouth&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>mouth<SPAN class="keyword">+@</SPAN>d<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>mouth<SPAN class="keyword">&gt;=</SPAN>Mouth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;mouth&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;Mouth&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;d&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">~@</SPAN>d<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>mouth<SPAN class="keyword">=&lt;</SPAN>MouthDelta&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;mouth&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;MouthDelta&nbsp;d&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;<SPAN class="keyword">~@</SPAN>d<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tk<SPAN class="keyword">.</SPAN>canvasTag<SPAN class="keyword">,</SPAN>tk(itemconfigure&nbsp;start:<SPAN class="keyword">@</SPAN>mouth&nbsp;extent:360<SPAN class="keyword">-</SPAN>2<SPAN class="keyword">*@</SPAN>mouth)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">close</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time<SPAN class="keyword">.</SPAN>repeat<SPAN class="keyword">,</SPAN>&nbsp;stop<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tk<SPAN class="keyword">.</SPAN>canvasTag<SPAN class="keyword">,</SPAN>&nbsp;tkClose<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">class</SPAN>&nbsp;<SPAN class="type">Manager</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">from</SPAN><SPAN class="type">&nbsp;Tk.canvas</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">prop</SPAN>&nbsp;final&nbsp;locking<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">attr</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Balls:&nbsp;&nbsp;nil<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Colors:&nbsp;BallColors<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">init</SPAN>(parent:P)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<SPAN class="keyword">self</SPAN>&nbsp;tkInit(parent:P&nbsp;bg:BackColor&nbsp;bd:3&nbsp;relief:sunken<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width:CanvasWidth&nbsp;height:CanvasHeight)}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<SPAN class="keyword">self</SPAN>&nbsp;tkBind(action:&nbsp;<SPAN class="keyword">self</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;NewBall<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event:&nbsp;&nbsp;<SPAN class="string">'&lt;1&gt;'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;args:&nbsp;&nbsp;&nbsp;[float(x)&nbsp;float(y)])}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<SPAN class="keyword">self</SPAN>&nbsp;tkBind(action:&nbsp;<SPAN class="keyword">self</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;KillBall<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event:&nbsp;&nbsp;<SPAN class="string">'&lt;3&gt;'</SPAN>)}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">NewBall</SPAN>(X&nbsp;Y)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">lock</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C<SPAN class="keyword">|</SPAN>Cr&nbsp;&nbsp;=&nbsp;<SPAN class="keyword">@</SPAN>Colors<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Balls&nbsp;&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;{New&nbsp;Ball&nbsp;init(X&nbsp;Y&nbsp;<SPAN class="keyword">self</SPAN>&nbsp;C)}<SPAN class="keyword">|@</SPAN>Balls<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Colors&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;Cr<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">KillBall</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">lock</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;<SPAN class="keyword">@</SPAN>Balls&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;nil&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="keyword">skip</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;B<SPAN class="keyword">|</SPAN>Br&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{B&nbsp;close}&nbsp;Balls&nbsp;<SPAN class="keyword">&lt;-</SPAN>&nbsp;Br<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Top&nbsp;=&nbsp;{New&nbsp;Tk<SPAN class="keyword">.</SPAN>toplevel&nbsp;tkInit(title:&nbsp;&nbsp;<SPAN class="string">'Oz&nbsp;Bouncer'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delete:&nbsp;Application<SPAN class="keyword">.</SPAN>exit&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;0)}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;{Tk<SPAN class="keyword">.</SPAN>send&nbsp;pack({New&nbsp;Manager&nbsp;init(parent:Top)})}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN class="keyword">end</SPAN>&nbsp;<BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="bounce.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>