Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bd5c3d824c3db63ffd9226c15941e6ad > files > 2345

mozart-1.4.0-1mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>3.7 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="node12.html#section.widgets-1.images">&lt;&lt; Prev</A></TD><TD><A href="node6.html">- Up -</A></TD></TR></TABLE><DIV id="section.widgets-1.messages"><H2><A name="section.widgets-1.messages">3.7 Messages</A></H2><DIV class="apropos"><P class="margin">aspect and justify</P><P> <A name="label127"></A>Message widgets display text extending over several lines. How the text is distributed over several lines is determined by one of the options <CODE>width</CODE> and <CODE>aspect</CODE>. <A name="label129"></A>Each of the line is justified according to the value of the option <CODE>justify</CODE>. Possible values are <A name="label131"></A><CODE>left</CODE> (the default value), <A name="label133"></A><CODE>center</CODE>, and <A name="label135"></A><CODE>right</CODE>. <A href="node13.html#figure.widgets-1.messages">Figure&nbsp;3.7</A> shows the result of different combinations of aspect and justification. </P></DIV><P> </P><DIV id="figure.widgets-1.messages"><HR><P><A name="figure.widgets-1.messages"></A></P><P> </P><DIV align="center"><IMG alt="" src="messages.gif"></DIV><P> <A name="label137"></A> </P><DL class="anonymous"><DD class="code"><CODE>S&nbsp;=<SPAN class="string">'Text&nbsp;extending&nbsp;over&nbsp;several&nbsp;lines.'</SPAN>&nbsp;<BR>Ms={Map&nbsp;[left<SPAN class="keyword">#</SPAN>200&nbsp;center<SPAN class="keyword">#</SPAN>100&nbsp;right<SPAN class="keyword">#</SPAN>50]<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;J<SPAN class="keyword">#</SPAN>A}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{New&nbsp;Tk<SPAN class="keyword">.</SPAN>message&nbsp;tkInit(parent:W&nbsp;text:S&nbsp;justify:J&nbsp;aspect:A)}<BR>&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>}<BR>{Tk<SPAN class="keyword">.</SPAN>send&nbsp;pack(b(Ms)&nbsp;side:left&nbsp;padx:2<SPAN class="keyword">#</SPAN>m&nbsp;pady:2<SPAN class="keyword">#</SPAN>m)}</CODE></DD></DL><P> </P><P class="caption"><STRONG>Figure&nbsp;3.7:</STRONG> Messages with <CODE>justify</CODE> and <CODE>aspect</CODE> options.</P><HR></DIV><P> </P><DIV class="apropos"><P class="margin">aspect and width</P><P> If the option <CODE>width</CODE> is present, the value (a screen distance, see <A href="node9.html#section.widgets-1.distances">Section&nbsp;3.3.2</A>) gives the length of each line. If no <CODE>width</CODE> option is present, the aspect ratio between height and width of the text is given by the option <CODE>aspect</CODE>. The value specifies the aspect as </P><BLOCKQUOTE class="code"><CODE>100&nbsp;<SPAN class="keyword">*</SPAN>&nbsp;</CODE><I>width</I><CODE>&nbsp;<SPAN class="keyword">/</SPAN>&nbsp;</CODE><I>height</I></BLOCKQUOTE><P> For example a value of <CODE>100</CODE> means that the text is as high as wide, a value of <CODE>200</CODE> means that the text is twice as wide as high. </P></DIV><P> Reference information on message widgets can be found in <A href="../tcltk/TkCmd/message.htm"><KBD>message</KBD></A>. </P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node12.html#section.widgets-1.images">&lt;&lt; Prev</A></TD><TD><A href="node6.html">- Up -</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 (20090610)</SPAN></ADDRESS></BODY></HTML>