This file is indexed.

/usr/share/mozart/doc/wp/node27.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>5.8 Scales</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="node26.html#section.widgets-2.entry">&lt;&lt; Prev</A></TD><TD><A href="node19.html">- Up -</A></TD><TD><A href="node28.html#section.widgets-2.listbox">Next &gt;&gt;</A></TD></TR></TABLE><DIV id="section.widgets-2.scale"><H2><A name="section.widgets-2.scale">5.8 Scales</A></H2><P> A scale widget allows to select a number from a certain range by moving a slider. Each time the slider is moved, an action attached to the slider is invoked with a single argument giving the current number value of the slider. </P><P> In <A href="node27.html#figure.widgets-2.scales">Figure&nbsp;5.9</A> an example is shown which allows to display a color determined by three sliders for the intensity of the base colors red, green, and blue. The object&nbsp;<CODE>F</CODE> stores the intensity for each base color in an attribute. Whenever the method <CODE>bg</CODE> is executed it changes the intensity for one of the base colors and changes the background color to the combination of all three base colors. </P><DIV id="figure.widgets-2.scales"><HR><P><A name="figure.widgets-2.scales"></A></P><P> </P><DIV align="center"><IMG alt="" src="scale.gif"></DIV><P> <A name="label244"></A> <A name="label246"></A> </P><DL class="anonymous"><DD class="code"><CODE>L&nbsp;={New&nbsp;<SPAN class="keyword">class</SPAN>&nbsp;<SPAN class="type">$</SPAN>&nbsp;<SPAN class="keyword">from</SPAN><SPAN class="type">&nbsp;Tk.listener</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">attr</SPAN>&nbsp;red:0&nbsp;green:0&nbsp;blue:0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">meth</SPAN>&nbsp;<SPAN class="functionname">bg</SPAN>(C&nbsp;I)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;<SPAN class="keyword">:=</SPAN>&nbsp;I&nbsp;{F&nbsp;tk(configure&nbsp;bg:c(<SPAN class="keyword">@</SPAN>red&nbsp;<SPAN class="keyword">@</SPAN>green&nbsp;<SPAN class="keyword">@</SPAN>blue))}<BR>&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;<SPAN class="keyword">end</SPAN>&nbsp;tkInit}<BR>F&nbsp;={New&nbsp;Tk<SPAN class="keyword">.</SPAN>frame&nbsp;tkInit(parent:W&nbsp;height:2<SPAN class="keyword">#</SPAN>c)}<BR>Ss={Map&nbsp;[red&nbsp;green&nbsp;blue]<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;C}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{New&nbsp;Tk<SPAN class="keyword">.</SPAN>scale&nbsp;tkInit(parent:W&nbsp;orient:horizontal&nbsp;length:8<SPAN class="keyword">#</SPAN>c<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;label:C&nbsp;<SPAN class="string">'from'</SPAN>:0&nbsp;to:255<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;action:&nbsp;L&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;bg(C)<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;args:&nbsp;&nbsp;&nbsp;[int])}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>}<BR>{Tk<SPAN class="keyword">.</SPAN>send&nbsp;pack(b(Ss)&nbsp;F&nbsp;fill:x)}</CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure&nbsp;5.9:</STRONG> Scales to configure a frame's background color.</P><HR></DIV><P> </P><P> The sliders are configured with the <CODE>label</CODE> option to display the name of the base color as their labels. The other options besides of <CODE>action</CODE> and <CODE>args</CODE> are self explanatory, more information on them can be found in <A href="../tcltk/TkCmd/scale.htm"><KBD>scale</KBD></A>. </P><P> The value for the <CODE>args</CODE> option must be a type specification similar to that used for the specification of argument types in event bindings (see <A href="node24.html#section.widgets-2.event-args">Section&nbsp;5.5.2</A>. The only difference is that no event argument specification is required. Invoking the action is also similar. For instance, if the scale for the color <CODE>red</CODE> changes its value to <CODE>10</CODE>, the message <CODE>bg(red&nbsp;10)</CODE> will eventually be served by the listener <CODE>L</CODE>. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node26.html#section.widgets-2.entry">&lt;&lt; Prev</A></TD><TD><A href="node19.html">- Up -</A></TD><TD><A href="node28.html#section.widgets-2.listbox">Next &gt;&gt;</A></TD></TR></TABLE><HR><ADDRESS><A href="http://www.ps.uni-sb.de/~schulte/">Christian&nbsp;Schulte</A><BR><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>