| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| 3 |
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>label (GCL TK Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="label (GCL TK Manual)"> |
| 9 |
<meta name="keywords" content="label (GCL TK Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| 13 |
<link href="index.html" rel="start" title="Top"> |
| 14 |
<link href="wm.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 15 |
<link href="Widgets.html" rel="up" title="Widgets"> |
| 16 |
<link href="radiobutton.html" rel="next" title="radiobutton"> |
| 17 |
<link href="frame.html" rel="prev" title="frame"> |
| 18 |
<style type="text/css"> |
| 19 |
<!-- |
| 20 |
a.summary-letter {text-decoration: none} |
| 21 |
blockquote.indentedblock {margin-right: 0em} |
| 22 |
div.display {margin-left: 3.2em} |
| 23 |
div.example {margin-left: 3.2em} |
| 24 |
div.lisp {margin-left: 3.2em} |
| 25 |
kbd {font-style: oblique} |
| 26 |
pre.display {font-family: inherit} |
| 27 |
pre.format {font-family: inherit} |
| 28 |
pre.menu-comment {font-family: serif} |
| 29 |
pre.menu-preformatted {font-family: serif} |
| 30 |
span.nolinebreak {white-space: nowrap} |
| 31 |
span.roman {font-family: initial; font-weight: normal} |
| 32 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| 33 |
ul.no-bullet {list-style: none} |
| 34 |
--> |
| 35 |
</style> |
| 36 |
|
| 37 |
|
| 38 |
</head> |
| 39 |
|
| 40 |
<body lang="en"> |
| 41 |
<span id="label"></span><div class="header"> |
| 42 |
<p> |
| 43 |
Next: <a href="radiobutton.html" accesskey="n" rel="next">radiobutton</a>, Previous: <a href="frame.html" accesskey="p" rel="prev">frame</a>, Up: <a href="Widgets.html" accesskey="u" rel="up">Widgets</a> [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> |
| 44 |
</div> |
| 45 |
<hr> |
| 46 |
<span id="label-1"></span><h3 class="section">2.13 label</h3> |
| 47 |
|
| 48 |
<p>label \- Create and manipulate label widgets |
| 49 |
</p><span id="Synopsis-12"></span><h4 class="unnumberedsubsec">Synopsis</h4> |
| 50 |
<p><b>label</b><i> </i><i>pathName </i><span class="roman">?</span><i>options</i>? |
| 51 |
</p><span id="Standard-Options-12"></span><h4 class="unnumberedsubsec">Standard Options</h4> |
| 52 |
|
| 53 |
|
| 54 |
<div class="example"> |
| 55 |
<pre class="example">anchor borderWidth foreground relief |
| 56 |
background cursor padX text |
| 57 |
bitmap font padY textVariable |
| 58 |
</pre></div> |
| 59 |
|
| 60 |
|
| 61 |
<p>See <a href="options.html">options</a>, for more information. |
| 62 |
</p><span id="Arguments-for-Label"></span><h4 class="unnumberedsubsec">Arguments for Label</h4> |
| 63 |
|
| 64 |
|
| 65 |
<dl compact="compact"> |
| 66 |
<dt><code><b>:height</b></code></dt> |
| 67 |
<dd><p align="right">Name=<code>"<b>height</b><span class="roman">"</span> Class=<code>"</code><b>Height</b>"</code> |
| 68 |
</p><br> |
| 69 |
|
| 70 |
<p>Specifies a desired height for the label. |
| 71 |
If a bitmap is being displayed in the label then the value is in |
| 72 |
screen units (i.e. any of the forms acceptable to <b>Tk_GetPixels</b>); |
| 73 |
for text it is in lines of text. |
| 74 |
If this option isn’t specified, the label’s desired height is computed |
| 75 |
from the size of the bitmap or text being displayed in it. |
| 76 |
</p></dd> |
| 77 |
</dl> |
| 78 |
|
| 79 |
|
| 80 |
<dl compact="compact"> |
| 81 |
<dt><code><b>:width</b></code></dt> |
| 82 |
<dd><p align="right">Name=<code>"<b>width</b><span class="roman">"</span> Class=<code>"</code><b>Width</b>"</code> |
| 83 |
</p><br> |
| 84 |
|
| 85 |
<p>Specifies a desired width for the label. |
| 86 |
If a bitmap is being displayed in the label then the value is in |
| 87 |
screen units (i.e. any of the forms acceptable to <b>Tk_GetPixels</b>); |
| 88 |
for text it is in characters. |
| 89 |
If this option isn’t specified, the label’s desired width is computed |
| 90 |
from the size of the bitmap or text being displayed in it. |
| 91 |
</p></dd> |
| 92 |
</dl> |
| 93 |
|
| 94 |
<span id="Description-9"></span><h4 class="unnumberedsubsec">Description</h4> |
| 95 |
|
| 96 |
<p>The <b>label</b> command creates a new window (given by the |
| 97 |
<i>pathName</i> argument) and makes it into a label widget. |
| 98 |
Additional |
| 99 |
options, described above, may be specified on the command line |
| 100 |
or in the option database |
| 101 |
to configure aspects of the label such as its colors, font, |
| 102 |
text, and initial relief. The <b>label</b> command returns its |
| 103 |
<i>pathName</i> argument. At the time this command is invoked, |
| 104 |
there must not exist a window named <i>pathName</i>, but |
| 105 |
<i>pathName</i>’s parent must exist. |
| 106 |
</p> |
| 107 |
<p>A label is a widget |
| 108 |
that displays a textual string or bitmap. |
| 109 |
The label can be manipulated in a few simple ways, such as |
| 110 |
changing its relief or text, using the commands described below. |
| 111 |
</p> |
| 112 |
<span id="A-Label-Widget_0027s-Arguments"></span><h4 class="unnumberedsubsec">A Label Widget’s Arguments</h4> |
| 113 |
|
| 114 |
<p>The <b>label</b> command creates a new Tcl command whose |
| 115 |
name is <i>pathName</i>. This |
| 116 |
command may be used to invoke various |
| 117 |
operations on the widget. It has the following general form: |
| 118 |
</p> |
| 119 |
<div class="example"> |
| 120 |
<pre class="example"><i>pathName option </i><span class="roman">?</span><i>arg arg ...</i>? |
| 121 |
</pre></div> |
| 122 |
|
| 123 |
<p><i>Option</i><span class="roman"> and the </span><i>arg</i>s |
| 124 |
determine the exact behavior of the command. The following |
| 125 |
commands are possible for label widgets: |
| 126 |
</p> |
| 127 |
<dl compact="compact"> |
| 128 |
<dt><i>pathName </i><b>:configure</b><span class="roman"> ?</span><i>option</i><span class="roman">? ?</span><i>value option value ...</i>?</dt> |
| 129 |
<dd><p>Query or modify the configuration options of the widget. |
| 130 |
If no <i>option</i> is specified, returns a list describing all of |
| 131 |
the available options for <i>pathName</i><span class="roman"> (see </span><b>Tk_ConfigureInfo</b> for |
| 132 |
information on the format of this list). If <i>option</i> is specified |
| 133 |
with no <i>value</i>, then the command returns a list describing the |
| 134 |
one named option (this list will be identical to the corresponding |
| 135 |
sublist of the value returned if no <i>option</i> is specified). If |
| 136 |
one or more <i>option:value</i> pairs are specified, then the command |
| 137 |
modifies the given widget option(s) to have the given value(s); in |
| 138 |
this case the command returns an empty string. |
| 139 |
<i>Option</i><span class="roman"> may have any of the values accepted by the </span><b>label</b> |
| 140 |
command. |
| 141 |
</p> |
| 142 |
</dd> |
| 143 |
</dl> |
| 144 |
<span id="Bindings-6"></span><h4 class="unnumberedsubsec">Bindings</h4> |
| 145 |
|
| 146 |
<p>When a new label is created, it has no default event bindings: |
| 147 |
labels are not intended to be interactive. |
| 148 |
</p> |
| 149 |
<span id="Keywords-12"></span><h4 class="unnumberedsubsec">Keywords</h4> |
| 150 |
<p>label, widget |
| 151 |
</p><hr> |
| 152 |
<div class="header"> |
| 153 |
<p> |
| 154 |
Next: <a href="radiobutton.html" accesskey="n" rel="next">radiobutton</a>, Previous: <a href="frame.html" accesskey="p" rel="prev">frame</a>, Up: <a href="Widgets.html" accesskey="u" rel="up">Widgets</a> [<a href="wm.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> |
| 155 |
</div> |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
</body> |
| 160 |
</html> |