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

📄 122.html

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


<P>  The common size options are <TT><NAME=#S12.2width>-width</A></TT> and <TT><NAME=#S12.2height>-height</A>.</TT>
The widgets whose size you will want to control are, for the most part, the
widgets that do not contain other widgets.

<P>  A part of the geometry management process is to determine a master widget's
desired size from the declared or desired sizes of its slaves.  This is
why you usually control size by using the size options on those slaves
which are not also masters.

<P>  The desired size of a master widget is not necessarily the size the widget
gets.  As you create your first windows, you should try to resize them with
your mouse so you can get used to what happens.  User resizing is only one
thing that can cause a geometry manager to override a master widget's desired
size.


<P>  Size options are measured in one of two ways:

<P><CENTER><TABLE BORDER><TR><TD><DL>

<P> <DT><STRONG>characters</STRONG><DD>   If the widget is concerned with text, then distance is measured by counting the number of characters.  For calculating width, an
average character width for the font is used.  For calculating height,
the size allocated to a line is used.

<P> <DT><STRONG>screen distance</STRONG><DD> If the widget is not concerned with characters, then
there are several units that can be used to declare screen distances.  

<P>  The usual screen distance measurement is a count of pixels.  That is
the unit Tk uses unless you  declare another with one of these suffixes:

<P><CENTER><TABLE BORDER><TR><TD><DL>
<P> <DT><STRONG><PRE><CITE>...</CITE>i</PRE></STRONG><DD> inches
<P> <DT><STRONG><PRE><CITE>...</CITE>c</PRE></STRONG><DD> centimeters
<P> <DT><STRONG><PRE><CITE>...</CITE>m</PRE></STRONG><DD> millimeters
<P> <DT><STRONG><PRE><CITE>...</CITE>p</PRE></STRONG><DD> printers' points
</DL></TD></TR></TABLE></CENTER></P>
Tk expects a nonnegative integer either by itself for a count of pixels
or with one of these suffixes for a measurement of the indicated kind.

<P>  Choose
the unit 
which fits your needs but see the discussion above in

<A HREF="11.6.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/11.6.html">Multiplatform Caveat</A>.
</DL></TD></TR></TABLE></CENTER></P>

<P>  Some widgets will accept measurements in either characters or screen
distances &#150; depending on how they are configured.  Buttons are this way, you
can label them with a character string or with an image.  The units you use
for a size option will be characters when the label is a character string and
screen distances when the label is an image.


<!-- 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.1.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.1.html">section</A><WBR>
<STRONG>Next</STRONG>
<A HREF="12.3.html" tppabs="http://www.mapfree.com/sbf/tcl/book/select/Html/12.3.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 + -