⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch21_12.htm

📁 by Randal L. Schwartz and Tom Phoenix ISBN 0-596-00132-0 Third Edition, published July 2001. (See
💻 HTM
📖 第 1 页 / 共 3 页
字号:
Assigns the tag to the item below the specified item in the displaylist</p></dd><dt><i> <tt class="literal">closest</tt></i></dt><dd>Assigns the tag to the item closest to the specified x,y coordinate</p></dd><dt><i> <tt class="literal">enclosed</tt></i></dt><dd>Assigns the tag to all items that are completely enclosed within thespecified bounding box</p></dd><dt><i> <tt class="literal">overlapping</tt></i></dt><dd>Assigns the tag to all items that are even partially inside thespecified bounding box</p></dd><dt><i> <tt class="literal">withtag</tt></i></dt><dd>Assigns the tag to all items with the specified tag</p></dd></dl></dd><dt><b><tt class="literal">bind</tt></b></dt><dd><a name="INDEX-3012" />Binds a callback to an item. (To bind acallback to the Canvas widget itself, you must specify Tk::bind.)</p></dd><dt><b><tt class="literal">bbox</tt></b></dt><dd><a name="INDEX-3013" />Returns the bounding box of an item.For example, to get the bounding box for all items in the canvas:</p><blockquote><pre class="code">$canvas-&gt;bbox("all");</pre></blockquote></dd><dt><b><tt class="literal">itemconfigure</tt></b></dt><dd><a name="INDEX-3014" />Configures one of the items within thecanvas. Works just like the <tt class="literal">configure</tt> method forwidgets, but the first argument is the tag name or ID for the canvasitem.</p></dd><dt><b><tt class="literal">itemcget</tt></b></dt><dd><a name="INDEX-3015" />Gets configuration information for oneof the items within the canvas. Works just like the<tt class="literal">cget</tt> method for widgets, but the first argument isthe tag name or ID for the canvas item.</p></dd><dt><b><tt class="literal">move</tt></b></dt><dd><a name="INDEX-3016" />Moves an item on the canvas by addingthe specified x and y distances to it:</p><blockquote><pre class="code">$canvas-&gt;move("circle1", 100, 100);</pre></blockquote></dd><dt><b><tt class="literal">coords</tt></b></dt><dd><a name="INDEX-3017" />Gets the current x,y coordinates for anitem, or moves an item to an explicit x,y coordinate.</p></dd><dt><b><tt class="literal">lower</tt></b></dt><dd><a name="INDEX-3018" />Sets the priority for the item in thedisplay list to be lower than the item identified by the specifiedtag or ID.</p></dd><dt><b><tt class="literal">raise</tt></b></dt><dd><a name="INDEX-3019" />Sets the priority for the item in thedisplay list to be higher than the item identified by the specifiedtag or ID.</p></dd><dt><b><tt class="literal">delete</tt></b></dt><dd><a name="INDEX-3020" />Removes an item from the canvas. Youcan specify as many tags or IDs in the argument list as you want.</p></dd><dt><b><tt class="literal">find</tt></b></dt><dd><a name="INDEX-3021" />Finds the specified items. The firstargument can be any of:</p><dl><dt><i> <tt class="literal">above</tt></i></dt><dd>Finds the item above the specified item in the display list</p></dd><dt><i> <tt class="literal">all</tt></i></dt><dd>Finds all items in the canvas</p></dd><dt><i> <tt class="literal">below</tt></i></dt><dd>Finds the item below the specified item in the display list</p></dd><dt><i> <tt class="literal">closest</tt></i></dt><dd>Finds the item closest to the specified x,y coordinate</p></dd><dt><i> <tt class="literal">enclosed</tt></i></dt><dd>Finds all items that are completely enclosed within the specifiedbounding box</p></dd><dt><i> <tt class="literal">overlapping</tt></i></dt><dd>Finds all items that are even partially inside the specified boundingbox</p></dd><dt><i> <tt class="literal">withtag</tt></i></dt><dd>Finds all items with the specified tag</p></dd></dl></dd><dt><b><tt class="literal">gettags</tt></b></dt><dd><a name="INDEX-3022" />Retrieves a list of all tags associatedwith an item.</p></dd><dt><b><tt class="literal">type</tt></b></dt><dd><a name="INDEX-3023" />Determines the type of the specifieditem.</p></dd><dt><b><tt class="literal">focus</tt></b></dt><dd><a name="INDEX-3024" />Assigns the keyboard focus to thespecified item.</p></dd><dt><b><tt class="literal">postscript</tt></b></dt><dd><a name="INDEX-3025" />Renders the canvas as PostScript.Options are:</p><dl><dt><i> <tt class="literal">-colormap =&gt; \@</tt><em class="replaceable"><tt>colorcommand</tt></em></i></dt><dd>Specifies a PostScript command for setting color values.</p></dd><dt><i> <tt class="literal">-colormode =&gt;</tt> <em class="replaceable"><tt>mode</tt></em></i></dt><dd>Sets the mode to <tt class="literal">color</tt> (full color),<tt class="literal">gray</tt> (grayscale), or <tt class="literal">mono</tt>(black and white).</p></dd><dt><i> <tt class="literal">-file =&gt;</tt> <em class="replaceable"><tt>filename</tt></em></i></dt><dd>The name of the file to store the PostScript output.</p></dd><dt><i> <tt class="literal">-fontmap =&gt; \@</tt><em class="replaceable"><tt>fontspec</tt></em></i></dt><dd>Specifies a font name and point size.</p></dd><dt><i> <tt class="literal">-height =&gt;</tt> <em class="replaceable"><tt>size</tt></em></i></dt><dd>The height of the area to print.</p></dd><dt><i> <tt class="literal">-pageanchor =&gt;</tt> <em class="replaceable"><tt>position</tt></em></i></dt><dd>The anchor position of the page. Values are <tt class="literal">center</tt>(default), <tt class="literal">n</tt>, <tt class="literal">e</tt>,<tt class="literal">s</tt>, and <tt class="literal">w</tt>.</p></dd><dt><i> <tt class="literal">-pageheight =&gt;</tt> <em class="replaceable"><tt>height</tt></em></i></dt><dd>The height of the printed page.</p></dd><dt><i> <tt class="literal">-pagewidth =&gt;</tt> <em class="replaceable"><tt>width</tt></em></i></dt><dd>The width of the printed page.</p></dd><dt><i> <tt class="literal">-pagex =&gt;</tt> <em class="replaceable"><tt>x</tt></em></i></dt><dd>The x positioning point.</p></dd><dt><i> <tt class="literal">-pagey =&gt;</tt> <em class="replaceable"><tt>y</tt></em></i></dt><dd>The y positioning point.</p></dd><dt><i> <tt class="literal">-rotate =&gt;</tt> <em class="replaceable"><tt>boolean</tt></em></i></dt><dd>Whether to rotate to landscape orientation. Default is<tt class="literal">0</tt>. </p></dd><dt><i> <tt class="literal">-width =&gt;</tt> <em class="replaceable"><tt>size</tt></em></i></dt><dd>The width of the area to print.</p></dd><dt><i> <tt class="literal">-x =&gt;</tt> <em class="replaceable"><tt>x</tt></em></i></dt><dd>The left edge of the canvas.</p></dd><dt><i> <tt class="literal">-y =&gt;</tt> <em class="replaceable"><tt>y</tt></em></i></dt><dd>The top edge of the canvas.</p></dd></dl></dd><dt><b><tt class="literal">scale</tt></b></dt><dd><a name="INDEX-3026" />Changes the scaling of the canvas orany individual items. For example, to scale the entire canvas to halfits dimensions:</p><blockquote><pre class="code">$canvas-&gt;scale("all", 0, 0, .5, .5);</pre></blockquote></dd><dt><b><tt class="literal">xview</tt></b></dt><dd><a name="INDEX-3027" />Manipulates the canvas area in view.With no arguments, returns a list of two numbers between 0 and 1,defining the portion of the canvas that is currently hidden on theleft and right sides, respectively. With arguments, the function of<tt class="literal">xview</tt> changes:</p><dl><dt><i> <tt class="literal">moveto</tt></i></dt><dd>Moves the specified fraction of the text to the left of the visibleportion.</p></dd><dt><i> <tt class="literal">scroll</tt></i></dt><dd>Scrolls the canvas left or right by the specified number of units orpages. Used primarily as a callback to a scrollbar; pressing on anarrow would move by units (characters), and pressing on the troughwould move by pages. The number is either <tt class="literal">1</tt> or<tt class="literal">-1</tt>, to move forwards or backwards, respectively.</p></dd></dl></dd><dt><b><tt class="literal">yview</tt></b></dt><dd><a name="INDEX-3028" />Manipulates the canvas in view. With noarguments, returns a list of two numbers between 0 and 1, definingthat portion of the canvas that is currently hidden on the top andbottom, respectively. With arguments, its function changes:</p><dl><dt><i> <tt class="literal">moveto</tt></i></dt><dd>Moves the specified fraction of the canvas area to the top of thevisible portion.</p></dd><dt><i> <tt class="literal">scroll</tt></i></dt><dd>Scrolls the canvas up or down by the specified number of units orpages. Used primarily as a callback to a scrollbar; pressing on anarrow would move by units (lines), and pressing on the trough wouldmove by pages. The number is either <tt class="literal">1</tt> or<tt class="literal">-1</tt>, to move forwards or backwards,respectively.<a name="INDEX-3029" /><a name="INDEX-3030" /><a name="INDEX-3031" /> </p></dd></dl></dd></dl></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch21_11.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch21_13.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">21.11. The Text Widget</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">21.13. The Scale Widget</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright &copy; 2002</a> O'Reilly &amp; Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -