This file is indexed.

/usr/share/mozart/doc/system/node82.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>28.1 Tickles</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="node81.html">- Up -</A></TD><TD><A href="node83.html#section.tk.objects">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.tk.tickles"><H2><A name="section.tk.tickles">28.1 Tickles</A></H2><P> <A name="label908"></A> <A name="label909"></A><EM>Tickles</EM> are Oz values used to communicate with the graphics engine. The graphics engine receives and executes tickles. The graphics engine is implemented in Tcl/Tk (see <A href="bib.html#ousterhout.94">[Ous94]</A>). In order to execute tickles the graphics engine first translates tickles into strings. This section defines tickles, defines how tickles are translated into strings, and presents the Oz procedures to send tickles. </P><DIV id="section.tk.tickles.syntax"><H3><A name="section.tk.tickles.syntax">28.1.1 Syntax</A></H3><P> The set of tickles contains virtual strings, boolean values, and so-called tickle-objects. A tickle-object is an object which is created from a class the Tk module provides for (all classes but <CODE>Tk<SPAN class="keyword">.</SPAN>listener</CODE>). Roughly spoken, the set of tickles is closed under record construction, where only records are allowed which do not contain names as features or as label. Proper records with the labels <CODE>v</CODE>, <CODE>b</CODE>, <CODE><SPAN class="keyword">#</SPAN></CODE>, and <CODE><SPAN class="keyword">|</SPAN></CODE> are special cases. Examples for tickles can be found in <A href="../wp/node8.html#section.widgets-1.tickles">Section&nbsp;3.2 of ``Window Programming in Mozart''</A>. </P><DIV id="figure.tk.tickle-def"><HR><P><A name="figure.tk.tickle-def"></A></P><DL class="anonymous"><DD class="code"><CODE><SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">IsTcl</SPAN>&nbsp;X}<BR>&nbsp;&nbsp;&nbsp;{IsBool&nbsp;X}&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;{IsUnit&nbsp;X}&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;{IsVirtualString&nbsp;X}&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;{IsTclObject&nbsp;X}&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;{IsRecord&nbsp;X}&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;{Not&nbsp;{Some&nbsp;{Arity&nbsp;X}&nbsp;IsName}}&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;{Not&nbsp;{IsName&nbsp;{Label&nbsp;X}}}&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;{Label&nbsp;X}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;&nbsp;v&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{Arity&nbsp;X}<SPAN class="keyword">==</SPAN>[1]&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;{IsVirtualString&nbsp;X<SPAN class="keyword">.</SPAN>1}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;&nbsp;b&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{Arity&nbsp;X}<SPAN class="keyword">==</SPAN>[1]&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;{All&nbsp;X<SPAN class="keyword">.</SPAN>1&nbsp;IsTcl}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;&nbsp;c&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{Arity&nbsp;X}<SPAN class="keyword">==</SPAN>[1&nbsp;2&nbsp;3]&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{All&nbsp;X&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;I}&nbsp;I<SPAN class="keyword">&gt;=</SPAN>0&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;I<SPAN class="keyword">&lt;=</SPAN>255&nbsp;<SPAN class="keyword">end</SPAN>}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;<SPAN class="string">'#'</SPAN>&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="keyword">false</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;<SPAN class="string">'|'</SPAN>&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="keyword">false</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;{Record<SPAN class="keyword">.</SPAN>all&nbsp;X&nbsp;IsTcl}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><P class="caption"><STRONG>Figure&nbsp;28.1:</STRONG> Procedure <CODE>IsTcl</CODE> tests whether a value is tickle.</P><HR></DIV><P> </P><P> The exact definition of a tickle is given by the procedure <CODE>IsTcl</CODE> which is shown in <A href="node82.html#figure.tk.tickle-def">Figure&nbsp;28.1</A>. The procedure <CODE>IsTcl</CODE> returns <CODE><SPAN class="keyword">true</SPAN></CODE>, if and only if <CODE>X</CODE> is a tickle. Otherwise <CODE><SPAN class="keyword">false</SPAN></CODE> is returned. The procedure <CODE>IsTclObject</CODE> tests whether an object is a tickle-object. Note that records which have the labels <CODE><SPAN class="keyword">#</SPAN></CODE> and <CODE><SPAN class="keyword">|</SPAN></CODE> are treated as virtual strings. Note that <CODE>IsTcl</CODE> and the following procedures serve as specification, the graphics engine itself employs well optimized routines instead. </P></DIV><DIV id="section.tk.tickles.translation"><H3><A name="section.tk.tickles.translation">28.1.2 Translation to Virtual Strings</A></H3><P> The translation of a tickle into a virtual string that then by the graphics agent is interpreted as a tcl command is shown in <A href="node82.html#figure.tk.tickle-trans">Figure&nbsp;28.2</A>. The used help routines are shown in <A href="node82.html#figure.tk.tickle-trans-help">Figure&nbsp;28.3</A>. </P><DIV id="figure.tk.tickle-trans"><HR><P><A name="figure.tk.tickle-trans"></A></P><DL class="anonymous"><DD class="code"><CODE><SPAN class="keyword">local</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">FieldToV</SPAN>&nbsp;AI&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{IsInt&nbsp;AI}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">''</SPAN>&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<SPAN class="string">'-'</SPAN><SPAN class="keyword">#</SPAN>{Quote&nbsp;AI}<SPAN class="keyword">#</SPAN><SPAN class="string">'&nbsp;'</SPAN>&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;{TclToV&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">RecordToV</SPAN>&nbsp;R&nbsp;AIs}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FoldR&nbsp;AIs&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;AI&nbsp;V}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FieldToV&nbsp;AI&nbsp;R<SPAN class="keyword">.</SPAN>AI}&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<SPAN class="string">'&nbsp;'</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;V<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<SPAN class="string">''</SPAN>}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">TclToV</SPAN>&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{IsBool&nbsp;Tcl}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;Tcl&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;0&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;1&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;{IsUnit&nbsp;Tcl}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">''</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;{IsVirtualString&nbsp;Tcl}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{Quote&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;{IsTclObject&nbsp;Tcl}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{TclObjectToV&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;{Label&nbsp;Tcl}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;o&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{RecordToV&nbsp;Tcl&nbsp;{Arity&nbsp;Tcl}}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;p&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;AI<SPAN class="keyword">|</SPAN>AIs={Arity&nbsp;Tcl}&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="string">'{'</SPAN><SPAN class="keyword">#</SPAN>{FieldToV&nbsp;AI&nbsp;Tcl<SPAN class="keyword">.</SPAN>AI}<SPAN class="keyword">#</SPAN><SPAN class="string">'.'</SPAN><SPAN class="keyword">#</SPAN>{RecordToV&nbsp;Tcl&nbsp;AIs}<SPAN class="keyword">#</SPAN><SPAN class="string">'}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;b&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{FoldR&nbsp;Tcl<SPAN class="keyword">.</SPAN>1&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;Tcl&nbsp;V}&nbsp;&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;&nbsp;{TclToV&nbsp;Tcl}<SPAN class="keyword">#</SPAN><SPAN class="string">'&nbsp;'</SPAN><SPAN class="keyword">#</SPAN>V<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;<SPAN class="keyword">end</SPAN>&nbsp;<SPAN class="string">''</SPAN>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;c&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">'#'</SPAN><SPAN class="keyword">#</SPAN>{Hex&nbsp;Tcl<SPAN class="keyword">.</SPAN>1}<SPAN class="keyword">#</SPAN>{Hex&nbsp;Tcl<SPAN class="keyword">.</SPAN>2}<SPAN class="keyword">#</SPAN>{Hex&nbsp;Tcl<SPAN class="keyword">.</SPAN>3}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;v&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;Tcl<SPAN class="keyword">.</SPAN>1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;s&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">'&quot;'</SPAN><SPAN class="keyword">#</SPAN>{RecordToV&nbsp;Tcl&nbsp;{Arity&nbsp;Tcl}}<SPAN class="keyword">#</SPAN><SPAN class="string">'&quot;'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;l&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">'['</SPAN><SPAN class="keyword">#</SPAN>{RecordToV&nbsp;Tcl&nbsp;{Arity&nbsp;Tcl}}<SPAN class="keyword">#</SPAN><SPAN class="string">']'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;q&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">'{'</SPAN><SPAN class="keyword">#</SPAN>{RecordToV&nbsp;Tcl&nbsp;{Arity&nbsp;Tcl}}<SPAN class="keyword">#</SPAN><SPAN class="string">'}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;{Quote&nbsp;{Label&nbsp;Tcl}}<SPAN class="keyword">#</SPAN><SPAN class="string">'&nbsp;'</SPAN><SPAN class="keyword">#</SPAN>{RecordToV&nbsp;Tcl&nbsp;{Arity&nbsp;Tcl}}<BR>&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><SPAN class="keyword">end</SPAN></CODE></DD></DL><P class="caption"><STRONG>Figure&nbsp;28.2:</STRONG> Procedure <CODE>TclToV</CODE> translates a tickle into a virtual string.</P><HR></DIV><P> </P><DIV id="figure.tk.tickle-trans-help"><HR><P><A name="figure.tk.tickle-trans-help"></A></P><P></P><DL><DT><SPAN class="chunktitle"><SPAN class="chunkborder">&lt;</SPAN><A name="label910">Definition of Octal</A><SPAN class="chunkborder">&gt;=</SPAN></SPAN></DT><DD class="code"><CODE><SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Octal</SPAN>&nbsp;I}<BR>&nbsp;&nbsp;&nbsp;[<SPAN class="string">&amp;\\</SPAN>&nbsp;(I&nbsp;<SPAN class="keyword">div</SPAN>&nbsp;64&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;<SPAN class="string">&amp;0</SPAN>)&nbsp;((I&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;64)&nbsp;<SPAN class="keyword">div</SPAN>&nbsp;8&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;<SPAN class="string">&amp;0</SPAN>)&nbsp;(I&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;8&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;<SPAN class="string">&amp;0</SPAN>)]<BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><P> </P><DL><DT><SPAN class="chunktitle"><SPAN class="chunkborder">&lt;</SPAN><A name="label911">Definition of Quote</A><SPAN class="chunkborder">&gt;=</SPAN></SPAN></DT><DD class="code"><CODE><SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Quote</SPAN>&nbsp;V}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;{VirtualString<SPAN class="keyword">.</SPAN>toString&nbsp;V}&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;nil&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;\&quot;\&quot;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;S&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FoldR&nbsp;S&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;I&nbsp;Ir}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;{Member&nbsp;I&nbsp;<SPAN class="string">&quot;{}[]\\$\&quot;;&quot;</SPAN>}&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&amp;\\</SPAN><SPAN class="keyword">|</SPAN>I<SPAN class="keyword">|</SPAN>Ir<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">elseif</SPAN>&nbsp;I<SPAN class="keyword">&lt;</SPAN>33&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;I<SPAN class="keyword">&gt;</SPAN>127&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{Append&nbsp;{Octal&nbsp;I}&nbsp;Ir}<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;I<SPAN class="keyword">|</SPAN>Ir<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;nil}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><P> </P><DL><DT><SPAN class="chunktitle"><SPAN class="chunkborder">&lt;</SPAN><A name="label912">Definition of Hex</A><SPAN class="chunkborder">&gt;=</SPAN></SPAN></DT><DD class="code"><CODE><SPAN class="keyword">local</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">HexDigit</SPAN>&nbsp;I}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;<SPAN class="keyword">if</SPAN>&nbsp;I<SPAN class="keyword">&gt;</SPAN>9&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&amp;a</SPAN><SPAN class="keyword">-</SPAN>10&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<SPAN class="string">&amp;0</SPAN>&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Hex</SPAN>&nbsp;I}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[{HexDigit&nbsp;I&nbsp;<SPAN class="keyword">div</SPAN>&nbsp;16}&nbsp;{HexDigit&nbsp;I&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;16}]<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR><SPAN class="keyword">end</SPAN></CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure&nbsp;28.3:</STRONG> Help routines to translate a tickle into a virtual string.</P><HR></DIV><P> </P></DIV><DIV id="section.tk.tickles.send"><H3><A name="section.tk.tickles.send">28.1.3 Sending Tickles</A></H3><P> Tickles can be send to the graphics engine with the following procedures. The graphics engine processes tickles in batches: it reads a batch of tickles and executes it. If no further batch can be read currently, it updates the graphics. After having updated the graphics, it checks whether user events are to be processed. </P><P> The Oz procedures to send tickles are asynchronous and preserve order: all tickles are processed in the same order they are send in. However, after the procedure has been executed, the graphics engine might not yet have executed the tickle. </P><P> </P><DL><DT><CODE>send</CODE> <A name="label914"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>send&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Sends <CODE>+<I>Tcl</I></CODE> to the graphics engine. </P></DD><DT><CODE>batch</CODE> <A name="label916"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>batch&nbsp;</CODE><CODE>+<I>TclS</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Sends a list of list of tickles <CODE>+<I>TclS</I></CODE> to the graphics engine. It is guaranteed that the graphics engine processes all tickles in <CODE><I>TclS</I></CODE> in a single batch. </P></DD></DL><P> </P></DIV><DIV id="section.tk.return-values"><H3><A name="section.tk.return-values">28.1.4 Sending Tickles and Returning Values</A></H3><P> In the same way as sending tickles to graphics engine, the engine can asynchronously send back return values which are strings. The following procedures send tickles and return the values returned by executing the tickles by the graphics engine. </P><P> </P><DL><DT><CODE>returnString</CODE> <A name="label918"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnString&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>S</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as string. </P></DD><DT><CODE>return</CODE> <A name="label920"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>return&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>S</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Shortcut for <CODE>Tk<SPAN class="keyword">.</SPAN>returnString</CODE>. </P></DD><DT><CODE>returnAtom</CODE> <A name="label922"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnAtom&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>A</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as string. </P></DD><DT><CODE>returnInt</CODE> <A name="label924"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnInt&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>IB</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as integer. If the result does not describe a number <CODE><SPAN class="keyword">false</SPAN></CODE> is returned. </P></DD><DT><CODE>returnFloat</CODE> <A name="label926"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnFloat&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>FB</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as float. If the result does not describe a number <CODE><SPAN class="keyword">false</SPAN></CODE> is returned. </P></DD><DT><CODE>returnListString</CODE> <A name="label928"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnListString&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Ss</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as list of strings. </P></DD><DT><CODE>returnList</CODE> <A name="label930"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnList&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>Ss</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Shortcut for <CODE>Tk<SPAN class="keyword">.</SPAN>returnListString</CODE>. </P></DD><DT><CODE>returnListAtom</CODE> <A name="label932"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnListAtom&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>ABs</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as list of atoms. If elements of the list do not form valid atoms, the list contains the element <CODE><SPAN class="keyword">false</SPAN></CODE> instead. </P></DD><DT><CODE>returnListInt</CODE> <A name="label934"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnListInt&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>IBs</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as list of integers. If elements of the list do not form valid numbers, the list contains the element <CODE><SPAN class="keyword">false</SPAN></CODE> instead. </P></DD><DT><CODE>returnListFloat</CODE> <A name="label936"></A> </DT><DD><BLOCKQUOTE class="synopsis"><P></P><BLOCKQUOTE class="code"><CODE>{Tk<SPAN class="keyword">.</SPAN>returnListFloat&nbsp;</CODE><CODE>+<I>Tcl</I></CODE><CODE>&nbsp;</CODE><CODE>?<I>FBs</I></CODE><CODE>}</CODE></BLOCKQUOTE><P> </P></BLOCKQUOTE></DD><DD><P>Returns the result of sending and executing <CODE>+<I>Tcl</I></CODE> as list of integers. If elements of the list do not form valid numbers, the list contains the element <CODE><SPAN class="keyword">false</SPAN></CODE> instead. </P></DD></DL><P> </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node81.html">- Up -</A></TD><TD><A href="node83.html#section.tk.objects">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~duchier/">Denys&nbsp;Duchier</A>, <A href="http://www.ps.uni-sb.de/~kornstae/">Leif&nbsp;Kornstaedt</A>, <A href="http://www.ps.uni-sb.de/~homik/">Martin&nbsp;Homik</A>, <A href="http://www.ps.uni-sb.de/~tmueller/">Tobias&nbsp;Müller</A>, <A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A> and&nbsp;<A href="http://www.info.ucl.ac.be/~pvr">Peter&nbsp;Van Roy</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>