projman/hlp/en/tk/label.htm
2015-10-19 14:27:31 +04:00

144 lines
8.4 KiB
HTML

<HTML><HEAD><TITLE>Tk Built-In Commands - label manual page</TITLE></HEAD><BODY>
<DL>
<DD><A HREF="label.htm#M2" NAME="L611">NAME</A>
<DL><DD>label - Create and manipulate label widgets</DL>
<DD><A HREF="label.htm#M3" NAME="L612">SYNOPSIS</A>
<DL>
<DD><B>label</B> <I>pathName </I>?<I>options</I>?
</DL>
<DD><A HREF="label.htm#M4" NAME="L613">STANDARD OPTIONS</A>
<DL>
<DD><A HREF="options.htm#M-activebackground -activeforeground -anchor">-activebackground -activeforeground -anchor</A>
<DD><A HREF="options.htm#M-background -bitmap -borderwidth">-background -bitmap -borderwidth</A>
<DD><A HREF="options.htm#M-cursor -disabledforeground -font">-cursor -disabledforeground -font</A>
<DD><A HREF="options.htm#M-foreground -highlightbackground -highlightcolor">-foreground -highlightbackground -highlightcolor</A>
<DD><A HREF="options.htm#M-highlightthickness -image -justify">-highlightthickness -image -justify</A>
<DD><A HREF="options.htm#M-padx -pady -relief">-padx -pady -relief</A>
<DD><A HREF="options.htm#M-takefocus -text -textvariable">-takefocus -text -textvariable</A>
<DD><A HREF="options.htm#M-underline -wraplength">-underline -wraplength</A>
</DL>
<DD><A HREF="label.htm#M13" NAME="L622">WIDGET-SPECIFIC OPTIONS</A>
<DL>
<DD><A HREF="label.htm#M14" NAME="L623">-height, height, Height</A>
<DD><A HREF="label.htm#M15" NAME="L624">-state, state, State</A>
<DD><A HREF="label.htm#M16" NAME="L625">-width, width, Width</A>
</DL>
<DD><A HREF="label.htm#M17" NAME="L626">DESCRIPTION</A>
<DD><A HREF="label.htm#M18" NAME="L627">WIDGET COMMAND</A>
<DL>
<DD><A HREF="label.htm#M19" NAME="L628"><I>pathName </I><B>cget</B> <I>option</I></A>
<DD><A HREF="label.htm#M20" NAME="L629"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
</DL>
<DD><A HREF="label.htm#M21" NAME="L630">BINDINGS</A>
<DD><A HREF="label.htm#M22" NAME="L631">KEYWORDS</A>
</DL><HR>
<H3><A NAME="M2">NAME</A></H3>
label - Create and manipulate label widgets
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B>label</B> <I>pathName </I>?<I>options</I>?<BR>
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
<DL>
<DT><B><A HREF="options.htm#M-activebackground -activeforeground -anchor">-activebackground -activeforeground -anchor</A></B>
<DT><B><A HREF="options.htm#M-background -bitmap -borderwidth">-background -bitmap -borderwidth</A></B>
<DT><B><A HREF="options.htm#M-cursor -disabledforeground -font">-cursor -disabledforeground -font</A></B>
<DT><B><A HREF="options.htm#M-foreground -highlightbackground -highlightcolor">-foreground -highlightbackground -highlightcolor</A></B>
<DT><B><A HREF="options.htm#M-highlightthickness -image -justify">-highlightthickness -image -justify</A></B>
<DT><B><A HREF="options.htm#M-padx -pady -relief">-padx -pady -relief</A></B>
<DT><B><A HREF="options.htm#M-takefocus -text -textvariable">-takefocus -text -textvariable</A></B>
<DT><B><A HREF="options.htm#M-underline -wraplength">-underline -wraplength</A></B>
</DL>
<H3><A NAME="M13">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<DT>Command-Line Name: <B><A NAME="M14">-height</A></B>
<DT>Database Name: <B>height</B>
<DT>Database Class: <B>Height</B>
<DD>Specifies a desired height for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in lines of text.
If this option isn't specified, the label's desired height is computed
from the size of the image or bitmap or text being displayed in it.
<P><DT>Command-Line Name: <B><A NAME="M15">-state</A></B>
<DT>Database Name: <B>state</B>
<DT>Database Class: <B>State</B>
<DD>Specifies one of three states for the label: <B>normal</B>, <B>active</B>,
or <B>disabled</B>. In normal state the button is displayed using the
<B>foreground</B> and <B>background</B> options. In active state
the label is displayed using the <B>activeForeground</B> and
<B>activeBackground</B> options. In the disabled state the
<B>disabledForeground</B> and <B>background</B> options determine how
the button is displayed.
<P><DT>Command-Line Name: <B><A NAME="M16">-width</A></B>
<DT>Database Name: <B>width</B>
<DT>Database Class: <B>Width</B>
<DD>Specifies a desired width for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units (i.e. any of the forms acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>);
for text it is in characters.
If this option isn't specified, the label's desired width is computed
from the size of the image or bitmap or text being displayed in it.
</DL>
<H3><A NAME="M17">DESCRIPTION</A></H3>
The <B>label</B> command creates a new window (given by the
<I>pathName</I> argument) and makes it into a label widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the label such as its colors, font,
text, and initial relief. The <B>label</B> command returns its
<I>pathName</I> argument. At the time this command is invoked,
there must not exist a window named <I>pathName</I>, but
<I>pathName</I>'s parent must exist.
<P>
A label is a widget that displays a textual string, bitmap or image.
If text is displayed, it must all be in a single font, but it
can occupy multiple lines on the screen (if it contains newlines
or if wrapping occurs because of the <B>wrapLength</B> option) and
one of the characters may optionally be underlined using the
<B>underline</B> option.
The label can be manipulated in a few simple ways, such as
changing its relief or text, using the commands described below.
<H3><A NAME="M18">WIDGET COMMAND</A></H3>
The <B>label</B> command creates a new Tcl command whose
name is <I>pathName</I>. This
command may be used to invoke various
operations on the widget. It has the following general form:
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
<I>Option</I> and the <I>arg</I>s
determine the exact behavior of the command. The following
commands are possible for label widgets:
<P>
<DL>
<P><DT><A NAME="M19"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
Returns the current value of the configuration option given
by <I>option</I>.
<I>Option</I> may have any of the values accepted by the <B>label</B>
command.
<P><DT><A NAME="M20"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
Query or modify the configuration options of the widget.
If no <I>option</I> is specified, returns a list describing all of
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the command returns a list describing the
one named option (this list will be identical to the corresponding
sublist of the value returned if no <I>option</I> is specified). If
one or more <I>option-value</I> pairs are specified, then the command
modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>label</B>
command.
<P></DL>
<H3><A NAME="M21">BINDINGS</A></H3>
When a new label is created, it has no default event bindings:
labels are not intended to be interactive.
<H3><A NAME="M22">KEYWORDS</A></H3>
<A href="../Keywords/L.htm#label">label</A>, <A href="../Keywords/W.htm#widget">widget</A>
<HR><PRE>
<A HREF="../copyright.htm">Copyright</A> &#169; 1990-1994 The Regents of the University of California.
<A HREF="../copyright.htm">Copyright</A> &#169; 1994-1996 Sun Microsystems, Inc.
<A HREF="../copyright.htm">Copyright</A> &#169; 1995-1997 Roger E. Critchlow Jr.</PRE>
</BODY></HTML>