/usr/share/mozart/doc/wp/node8.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>3.2 The Graphics Engine, Tickles, and Widget Messages</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="node7.html#section.widgets-1.toplevel"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="node9.html#section.widgets-1.frame">Next >></A></TD></TR></TABLE><DIV id="section.widgets-1.tickles"><H2><A name="section.widgets-1.tickles">3.2 The Graphics Engine, Tickles, and Widget Messages</A></H2><P> Widget objects as well as instances of other classes defined in the <A name="label49"></A><SPAN class="index"><CODE>Tk</CODE> module</SPAN> are built as object oriented frontends to a single graphical agent, the <A name="label50"></A><EM>graphics engine</EM>. </P><H3><A name="label51">3.2.1 The Graphics Engine</A></H3><P> The graphics engine receives messages and executes them. By executing a message the engine creates widgets, configures the appearance and behavior of widgets, or computes a geometry for the layout of a widget on the screen. </P><DIV class="apropos"><P class="margin">tickles</P><P> The messages the engine understands are <A name="label52"></A><EM>tickles</EM>. The procedures <A name="label54"></A><CODE>Tk<SPAN class="keyword">.</SPAN>send</CODE> and <A name="label56"></A><CODE>Tk<SPAN class="keyword">.</SPAN>batch</CODE> take a tickle or a list of tickles and send it to the graphics engine. We use these two procedures especially to send tickles for geometry management, as is discussed in <A href="node14.html#chapter.geometry">Chapter 4</A>. </P></DIV><DIV class="apropos"><P class="margin">translating object messages to tickles</P><P> Messages sent to widgets and other objects of the Tk interface are translated in a straightforward fashion to tickles. These tickles are then forwarded to the graphics engine. </P></DIV><H3><A name="label57">3.2.2 Tickles and Widget Messages</A></H3><P> Tickles are used to describe messages for the graphics engine. A <A name="label58"></A><EM>tickle</EM> is either a boolean value, the name <CODE><SPAN class="keyword">unit</SPAN></CODE>, a virtual string, a record that has neither a name as label nor as feature, or a tickle object. A <A name="label59"></A><EM>tickle object</EM> is any instance of a class that the Tk module provides, unless otherwise mentioned (the only exception is the class <CODE>Tk<SPAN class="keyword">.</SPAN>listener</CODE>, see <A href="node25.html#section.widgets-2.action">Section 5.6</A>). </P><P> An initialization message with label <CODE>tkInit</CODE> must be a record without integer features. The field of a feature must be a tickle. Only the special features <CODE>parent</CODE>, <CODE>action</CODE>, <CODE>url</CODE>, and <CODE>args</CODE> may take different values. These features we will discuss later. </P><DIV class="apropos"><P class="margin">options</P><P> To the features we refer to as <A name="label60"></A><EM>configuration options</EM>, or for short as <A name="label61"></A><EM>options</EM>. Their values we refer to as <A name="label62"></A><EM>option values</EM>. </P></DIV><DIV class="apropos"><P class="margin">commands and arguments</P><P> A message with label <CODE>tk</CODE> must be a record with at least a single integer feature and maybe some other integer features and some options. The value of the first integer feature we call the <A name="label63"></A><EM>command</EM>, whereas we refer to the remaining values for the integer features as <A name="label64"></A><EM>arguments</EM>. For example, in the message </P><BLOCKQUOTE class="code"><CODE>tk(set active background:purple)</CODE></BLOCKQUOTE><P> <CODE>set</CODE> is the command, <CODE>active</CODE> is the single argument, and <CODE>background</CODE> is an option with value <CODE>purple</CODE>. </P></DIV><H3><A name="label65">3.2.3 Translating Tickles</A></H3><P> <A name="label66"></A> The graphics engine does not understand tickles but strings that follow a particular structure. This means that each tickle sent to the graphics engine is first translated to a string. The translation is generic, for our purposes here it suffices to give a short example. The full translation details can be found in <A href="../system/node81.html#chapter.tk">Chapter 28 of ``System Modules''</A>. </P><P> For example, </P><BLOCKQUOTE class="code"><CODE>example(<SPAN class="string">"test"</SPAN> 1 2<SPAN class="keyword">.</SPAN>0 side:left(right:<SPAN class="keyword">true</SPAN>) fill:x)</CODE></BLOCKQUOTE><P> is translated to </P><BLOCKQUOTE class="code"><CODE><SPAN class="string">"example test 1 2.0 -side left -right 1 -fill x"</SPAN></CODE></BLOCKQUOTE><P> That is, a record is translated to a string consisting of the label and the features and the translation of the fields. Atomic features are prepended by a <CODE><SPAN class="string">"-"</SPAN></CODE> and integer features are ignored. </P><H3><A name="label67">3.2.4 Special Tickles</A></H3><P> <A name="label68"></A>Additionally, special tickles are supported (see <A href="node8.html#figure.widgets-1.special">Table 3.1</A>). Their usage becomes clear in the examples that are presented in this document. </P><P> </P><DIV class="table" id="figure.widgets-1.special"><HR><P><A name="figure.widgets-1.special"></A></P></DIV><TABLE align="center" bgcolor="#f0f0e0"><TR valign="top"><TH><P>Example</P></TH><TH><P>Translation</P></TH><TH><P>Mnemonic</P></TH><TH><P>Used</P></TH></TR><TR valign="top"><TD><P><CODE>o(10 12 fill:red)</CODE></P></TD><TD><P><CODE>10 12 -fill red</CODE></P></TD><TD><P>option</P></TD><TD><P>see <A href="node34.html#figure.canvas.barchart">Figure 6.1</A></P></TD></TR><TR valign="top"><TD><P><CODE>l(red green blue)</CODE></P></TD><TD><P><CODE>[red green blue]</CODE></P></TD><TD><P>list</P></TD><TD><P>list of tickles</P></TD></TR><TR valign="top"><TD><P><CODE>q(red green blue)</CODE></P></TD><TD><P><CODE>{red green blue}</CODE></P></TD><TD><P>quote</P></TD><TD><P>see <A href="node34.html#figure.canvas.barchart">Figure 6.1</A></P></TD></TR><TR valign="top"><TD><P><CODE>s(red green blue)</CODE></P></TD><TD><P><CODE><SPAN class="string">"red green blue"</SPAN></CODE></P></TD><TD><P>string</P></TD><TD><P>string of tickles</P></TD></TR><TR valign="top"><TD><P><CODE>p(4 7 linestart)</CODE></P></TD><TD><P><CODE>{4.7 linestart}</CODE></P></TD><TD><P>position</P></TD><TD><P>see <A href="node38.html#para.text.position">*</A></P></TD></TR><TR valign="top"><TD><P><CODE>b([a(b:1) c(d:2)])</CODE></P></TD><TD><P><CODE>a -b 1 c -d 2</CODE></P></TD><TD><P>batch</P></TD><TD><P>see <A href="node16.html#para.geometry.batch">*</A></P></TD></TR><TR valign="top"><TD><P><CODE>v(1<SPAN class="keyword">#</SPAN><SPAN class="string">"\nno quote"</SPAN>)</CODE></P></TD><TD><P><CODE>1\nno quote</CODE></P></TD><TD><P>virtual string</P></TD><TD><P>verbatim virtual strings</P></TD></TR><TR valign="top"><TD><P><CODE>c(255 128 0)</CODE></P></TD><TD><P><CODE>#<SPAN class="comment">FF8000</SPAN></CODE></P></TD><TD><P>color</P></TD><TD><P>see <A href="node27.html#figure.widgets-2.scales">Figure 5.9</A></P></TD></TR><TR valign="top"><TD><P><CODE>d(pack(grid row:4))</CODE></P></TD><TD><P><CODE>grid -row 4</CODE></P></TD><TD><P>delete</P></TD><TD><P>skip record label</P></TD></TR></TABLE><DIV class="table"><P class="caption"><STRONG>Table 3.1:</STRONG> Examples of special tickles.</P><HR></DIV><P> </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node7.html#section.widgets-1.toplevel"><< Prev</A></TD><TD><A href="node6.html">- Up -</A></TD><TD><A href="node9.html#section.widgets-1.frame">Next >></A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|