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

📄 126.html

📁 Tcl 语言的入门级图书
💻 HTML
字号:
<HTML><TITLE>Widget Characteristics: Mouse Cursor</TITLE><BODY BGCOLOR="#FFF0E0" VLINK="#0FBD0F" TEXT="#101000" LINK="#0F0FDD">
<A NAME="top"><H1>Mouse Cursor</H1></A>


<P>  All widget classes have a <TT><NAME=#S12.6cursor>-cursor</A></TT> option which defines the
appearance of the mouse cursor when it is over the subwindow that displays the
widget.

<P>  Tk has some built-in cursors which you can access with this form of the
<TT>-cursor</TT> option,

<PRE>
-cursor <CITE>CURSOR_NAME</CITE> 
</PRE>

Here are some possible values for <CITE>CURSOR_NAME</CITE>.

<DL><DD>
<P>   X_cursor, target, plus, tcross, crosshair, xterm, circle,
man, gumby, mouse, spider, spraycan, pencil, arrow, center_ptr
</DL>

<P>  Here is an example that creates and packs a frame in such a way that the
mouse cursor will have the appearance specified by X_cursor when it is over
the frame.

<PRE>
pack [frame .fr -width 1c -height 1c -cursor X_cursor]
</PRE>

<P>  The <TT>-cursor</TT> option has other variations that let you control colors and
load your own bitmaps.  See your on-line manual.

<P> <P><A NAME="12.6a">
<STRONG>Exercise 12.6a</STRONG> </A><DL><DD>
  Create and display a frame which shows all of the
cursors listed above &#150; one at a time.  Use the left mouse button as a trigger
to cycle through the different cursors by finishing this <TT>bind</TT> command,

<PRE>
bind <CITE>FRAME_WIDGET_PATH</CITE> &#60;Button-1&#62; ...
</PRE>

<P>  Keep track of which cursor is being used by printing its name in the
command window.
<P>
<A HREF="12.8.html#Sol12.6a" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.8.html#Sol12.6a">Solution</A></DL>


<!-- Linkbar -->
<P><CENTER><FONT SIZE=2><NOBR>
<STRONG>From</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/sbf/tcl/book/home.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/sbf/tcl/book/home.html'" tppabs="http://www.mapfree.com/sbf/tcl/book/home.html">Tcl/Tk For Programmers</A><WBR>
<STRONG>Previous</STRONG>
<A HREF="12.5.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.5.html">section</A><WBR>
<STRONG>Next</STRONG>
<A HREF="12.7.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.7.html">section</A><WBR>
<STRONG>All</STRONG>
<A HREF="12.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.html">sections</A><WBR>
<STRONG>Author</STRONG>
<A HREF="javascript:if(confirm('http://www.mapfree.com/mp/jaz/home.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mapfree.com/mp/jaz/home.html'" tppabs="http://www.mapfree.com/mp/jaz/home.html">J. A. Zimmer</A><WBR>
<STRONG>Copyright</STRONG>
<A HREF="copyright.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/copyright.html">Notice</A><WBR>
<P>
<I>Jun 17, 1998</I>
 </NOBR></FONT></CENTER></BODY></HTML>


⌨️ 快捷键说明

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