/usr/share/mozart/doc/wp/node39.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>7.2 Text Tags and Marks</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="node38.html#section.text.widget"><< Prev</A></TD><TD><A href="node37.html">- Up -</A></TD><TD><A href="node40.html#section.text.toy">Next >></A></TD></TR></TABLE><DIV id="section.text.tags"><H2><A name="section.text.tags">7.2 Text Tags and Marks</A></H2><DIV class="apropos"><P class="margin">creating tags</P><P> <A name="label319"></A> In the same way as canvas widgets, text widgets support tags. While canvas tags refer to sets of items (see <A href="node39.html#section.text.tags">Section 7.2</A>), text tags refer to sets of characters and allow to configure and manipulate the set of characters. For example, the following <A name="label321"></A> </P><DL class="anonymous"><DD class="code"><CODE>B={New Tk<SPAN class="keyword">.</SPAN>textTag tkInit(parent:T foreground:brown)}</CODE></DD></DL><P> creates a new tag, where the tag is configured such that all characters that will be referred to by this tag (initially, no characters) are displayed in brown color. </P></DIV><DIV class="apropos"><P class="margin">adding text</P><P> Already inserted text can be added to a tag by defining the text portion to be added with positions. The following </P><DL class="anonymous"><DD class="code"><CODE>{B tk(add p(1 10) p(1 15))}</CODE></DD></DL><P> adds the text part <KBD>"brown"</KBD> to the tag <CODE>B</CODE>, which changes the color of that text to brown. </P></DIV><DIV class="apropos"><P class="margin">configuring tags</P><P> Changing the configuration of a tag takes effect on all characters that are referred to by that tag. For example, if the tag <CODE>B</CODE> is configured for a larger font as follows </P><DL class="anonymous"><DD class="code"><CODE>{B tk(configure font:{New Tk<SPAN class="keyword">.</SPAN>font tkInit(size:18)})}</CODE></DD></DL><P> the text portion <KBD>"brown"</KBD> now appears in that larger font. </P></DIV><DIV class="apropos"><P class="margin">inserting and adding text</P><P> The <CODE>insert</CODE> command also supports tags directly. The following </P><DL class="anonymous"><DD class="code"><CODE>{T tk(insert <SPAN class="string">'end'</SPAN> <SPAN class="string">"\nDogs are "</SPAN>)}<BR>{T tk(insert <SPAN class="string">'end'</SPAN> <SPAN class="string">"brown"</SPAN> B)}<BR>{T tk(insert <SPAN class="string">'end'</SPAN> <SPAN class="string">" as well."</SPAN>)}</CODE></DD></DL><P> adds three portions of text to the text widget, where the text <KBD>"brown"</KBD> is both inserted and added to the tag <CODE>B</CODE>, which makes it appear both in brown color and with a large font. Now the text widget looks as shown in <A href="node39.html#figure.text.tags">Figure 7.2</A>. </P></DIV><P> </P><DIV id="figure.text.tags"><HR><P><A name="figure.text.tags"></A></P><DIV align="center"><IMG alt="" src="text-tags.gif"></DIV><P class="caption"><STRONG>Figure 7.2:</STRONG> Using tags with text widgets.</P><HR></DIV><P> </P><P> In the same way as described in <A href="node35.html#section.canvas.tags">Section 6.3</A> for canvas tags, events can be attached to text tags. We will exemplify this in the <A href="node40.html#section.text.toy">next section</A>. </P><P><A name="label323"></A> <A name="label325"></A> In addition to tags, text widgets also support <A name="label326"></A><EM>marks</EM>. Marks refer to positions in the text rather than to particular characters as tags do. They are supported by the class <CODE>Tk<SPAN class="keyword">.</SPAN>textMark</CODE>. For their use, see again <A href="../tcltk/TkCmd/text.htm"><KBD>text</KBD></A>. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node38.html#section.text.widget"><< Prev</A></TD><TD><A href="node37.html">- Up -</A></TD><TD><A href="node40.html#section.text.toy">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>
|