label.html
来自「是TCL的另外一个编译(解释)器」· HTML 代码 · 共 332 行
HTML
332 行
<HTML><HEAD><TITLE>Label</TITLE></HEAD><BODY BGCOLOR=white><DL><DT><I><A HREF="#descr">NAME</A></I></DT><DD><B>Label</B> - Label widget with <B>state</B> option, dynamic help and drag and drop facilities</DD></DL><DL><DT><I>CREATION</I></DT><DD><A HREF="#descr"><B>Label</B></A> <I>pathName</I> ?<I>option value...</I>?</DD></DL><DL><DT><I>STANDARD OPTIONS</I></DT><DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0><TR><TD> <A HREF="options.htm#M-anchor">-anchor</A></TR><TD> <A HREF="options.htm#M-background">-background or -bg</A></TD></TR><TR><TD> <A HREF="options.htm#M-bitmap">-bitmap</A></TR><TD> <A HREF="options.htm#M-borderwidth">-borderwidth or -bd</A></TD></TR><TR><TD> <A HREF="options.htm#M-cursor">-cursor</A></TR><TD> <A HREF="options.htm#M-disabledforeground">-disabledforeground</A></TR></TR><TR><TD> <A HREF="options.htm#M-font">-font</A></TR><TD> <A HREF="options.htm#M-foreground">-foreground or -fg</A></TD></TR><TR><TD> <A HREF="options.htm#M-highlightbackground">-highlightbackground</A></TR><TD> <A HREF="options.htm#M-highlightcolor">-highlightcolor</A></TR></TR><TR><TD> <A HREF="options.htm#M-highlightthickness">-highlightthickness</A></TR><TD> <A HREF="options.htm#M-image">-image</A></TR></TR><TR><TD> <A HREF="options.htm#M-justify">-justify</A></TR><TD> <A HREF="options.htm#M-padx">-padx</A></TR></TR><TR><TD> <A HREF="options.htm#M-pady">-pady</A></TR><TD> <A HREF="options.htm#M-relief">-relief</A></TR></TR><TR><TD> <A HREF="options.htm#M-takefocus">-takefocus</A></TR><TD> <A HREF="options.htm#M-text">-text</A></TR></TR><TR><TD> <A HREF="options.htm#M-textvariable">-textvariable</A></TR><TD> <A HREF="options.htm#M-wraplength">-wraplength</A></TR></TR></TABLE></DD></DL><DL><DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT><DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0><TR><TD> <A HREF="#-dragenabled">-dragenabled</A></TR><TD> <A HREF="#-dragendcmd">-dragendcmd</A></TR></TR><TR><TD> <A HREF="#-dragevent">-dragevent</A></TR><TD> <A HREF="#-draginitcmd">-draginitcmd</A></TR></TR><TR><TD> <A HREF="#-dragtype">-dragtype</A></TR><TD> <A HREF="#-dropcmd">-dropcmd</A></TR></TR><TR><TD> <A HREF="#-dropenabled">-dropenabled</A></TR><TD> <A HREF="#-dropovercmd">-dropovercmd</A></TR></TR><TR><TD> <A HREF="#-droptypes">-droptypes</A></TR><TD> <A HREF="#-focus">-focus</A></TR></TR><TR><TD> <A HREF="#-height">-height</A></TR><TD> <A HREF="#-helptext">-helptext</A></TR></TR><TR><TD> <A HREF="#-helptype">-helptype</A></TR><TD> <A HREF="#-helpvar">-helpvar</A></TR></TR><TR><TD> <A HREF="#-name">-name</A></TR><TD> <A HREF="#-state">-state</A></TR></TR><TR><TD> <A HREF="#-underline">-underline</A></TR><TD> <A HREF="#-width">-width</A></TR></TR></TABLE></DD></DL><DL><DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT><DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A> <I>option</I></DD><DD><I>pathName</I> <A HREF="#configure"><B>configure</B></A> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?</DD><DD><I>pathName</I> <A HREF="#setfocus"><B>setfocus</B></A></DD></DL><BR><HR WIDTH="100%"><BR><B><A NAME="descr"></A>DESCRIPTION</B><BR><P>The <B>Label</B> widget extends the default Tk label. Options have been added to providevisual effect depending on the state of the Label, <A HREF="DynamicHelp.html">DynamicHelp</A> options, and <A HREF="DragSite.html">Drag</A> and <A HREF="DropSite.html">Drop</A>.</P><BR><HR WIDTH="50%"><BR><B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR><DL><DT><A NAME="-dragenabled"><B>-dragenabled</B></A></DT><DD>A boolean specifying if drag is enabled.</DD></DL><DL><DT><A NAME="-dragendcmd"><B>-dragendcmd</B></A></DT><DD>Specifies a command to be called when drag ended.<B>dragendcmd</B> must be a command conforming to the description of theoption <B>dragendcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.</DD></DL><DL><DT><A NAME="-dragevent"><B>-dragevent</B></A></DT><DD>Specifies the number of the mouse button associated to the drag.Must be <B>1</B>, <B>2</B> or <B>3</B>.</DD></DL><DL><DT><A NAME="-draginitcmd"><B>-draginitcmd</B></A></DT><DD>Specifies a command to be called when <B>dragevent</B> occurs on widget.<B>draginitcmd</B> must be a command conforming to the description of theoption <B>draginitcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.<BR>If <B>draginitcmd</B> is empty, the internal <B>draginitcmd</B> command is used insteadand returns:<DL><DD><TABLE BORDER=0 CELLSPACING=1><TR><TD valign=top><I>IMAGE {copy} <image name></I><TD>if an image is displayed.<TR><TD valign=top><I>BITMAP {copy} <bitmap name></I><TD>if a bitmap is displayed.<TR><TD valign=top><I>TEXT {copy} <text></I><TD>if a text is displayed.</TABLE></DL>Note that if <B>dragtype</B> option is not empty, its value is used instead of those above.</DD></DL><DL><DT><A NAME="-dragtype"><B>-dragtype</B></A></DT><DD>Specifies an alternate type of dragged object.</DD></DL><DL><DT><A NAME="-dropcmd"><B>-dropcmd</B></A></DT><DD>Specifies a command to be called when drop occurs on the widget.<B>dropcmd</B> must be a command conforming to the description of theoption <B>dropcmd</B> of <B>DropSite::<A HREF="DropSite.html#register">register</A></B>.<BR>If <B>dropcmd</B> is empty, the command updates the label following the type of the data:<DL><DD><TABLE BORDER=0 CELLSPACING=1><TR><TD><I>COLOR</I> or <I>FGCOLOR</I></TD><TD>reconfigure the <B>foreground</B> of the Label.</TD><TR><TD><I>BGCOLOR</I></TD><TD>reconfigure the <B>background</B> of the Label.</TD><TR><TD><I>IMAGE</I></TD><TD>reconfigure the Label to display the associated image.</TD><TR><TD><I>BITMAP</I></TD><TD>reconfigure the Label to display the associated bitmap.<B>image</B> option is set to empty.</TD><TR><TD><I>TEXT</I>,<BR>or any other tag</TD><TD>reconfigure the Label to display the associated string.<B>image</B> and <B>bitmap</B> options are set to empty.</TD></TABLE></DL>and returns 1.</DD></DL><DL><DT><A NAME="-dropenabled"><B>-dropenabled</B></A></DT><DD>A boolean specifying if drop is enabled.</DD></DL><DL><DT><A NAME="-dropovercmd"><B>-dropovercmd</B></A></DT><DD>Specifies a command to be called when drag icon is over the widget.<B>dropovercmd</B> must be a command conforming to the description of theoption <B>dropovercmd</B> of <B>DropSite::<A HREF="DropSite.html#register">register</A></B>.<BR>If <B>dropovercmd</B> is empty, Label always accepts the drop if data type is<I>FGCOLOR</I>, <I>COLOR</I>, <I>BGCOLOR</I>, and accepts all other data type only if<B>state</B> is normal.</DD></DL><DL><DT><A NAME="-droptypes"><B>-droptypes</B></A></DT><DD>Specifies a list of accepted dropped object/operation.See option <B>droptypes</B> of<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.for more infromation.Default accepts <I>FGCOLOR</I>, <I>COLOR</I>, <I>BGCOLOR</I>, <I>TEXT</I>, <I>BITMAP</I>and <I>IMAGE</I>, all with <B>copy</B> and <B>move</B> operations.</DD></DL><DL><DT><A NAME="-focus"><B>-focus</B></A></DT><DD>Specifies a pathname to set the focus on for Label::<B>setfocus</B> command.</DD></DL><DL><DT><A NAME="-height"><B>-height</B></A></DT><DD>Specifies a desired height for the label.If an image or bitmap is being displayed in the label then the value is inscreen units, for text it is in lines of text.If this option isn't specified, the label's desired height is computedfrom the size of the image or bitmap or text being displayed in it.</DD></DL><DL><DT><A NAME="-helptext"><B>-helptext</B></A></DT><DD>Text for dynamic help. If empty, no help is available for this widget.See also <A HREF="DynamicHelp.html">DynamicHelp</A>.</DD></DL><DL><DT><A NAME="-helptype"><B>-helptype</B></A></DT><DD>Type of dynamic help. Use <I>balloon</I> or <I>variable</I>.See also <A HREF="DynamicHelp.html">DynamicHelp</A>.</DD></DL><DL><DT><A NAME="-helpvar"><B>-helpvar</B></A></DT><DD>Variable to use when <B>helptype</B> option is <I>variable</I>.See also <A HREF="DynamicHelp.html">DynamicHelp</A>.</DD></DL><DL><DT><A NAME="-name"><B>-name</B></A></DT><DD>Specifies a standard name for the label. If the option <B>*<I>name</I>Name</B> isfound in the resource database, then <B>text</B> and <B>underline</B> optionsare extracted from its value.</DD></DL><DL><DT><A NAME="-state"><B>-state</B></A></DT><DD>Specifies one of two states for the Label: <B>normal</B> or <B>disabled</B>.In normal state the text of the Label is displayed using the <B>foreground</B> option.In disabled state the text of the Label is displayed using the <B>disabledforeground</B> option.</DD></DL><DL><DT><A NAME="-underline"><B>-underline</B></A></DT><DD>Specifies the integer index of a character to underline in the label.0 corresponds to the first character of the text displayed, 1 to the next character,and so on.<BR>The binding <B><Alt-<I>char</I>></B> is automatically set on the toplevelof the Label to call Label::<B>setfocus</B>.</DD></DL><DL><DT><A NAME="-width"><B>-width</B></A></DT><DD>Specifies a desired width for the label.If an image or bitmap is being displayed in the label then the value is inscreen units, for text it is in characters.If this option isn't specified, the label's desired width is computedfrom the size of the image or bitmap or text being displayed in it.</DD></DL><HR WIDTH="50%"><BR><B><A NAME="wc">WIDGET COMMAND</A></B><BR><DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A> <I>option</I></DT><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 creation command.</DD></DL><DL><DT><A NAME="configure"><I>pathName</I> <B>configure</B></A> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?</DT><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>.If <I>option</I> is specified with no <I>value</I>, then the command returns a listdescribing the one named <I>option</I> (this list will be identical to the correspondingsublist of the value returned if no <I>option</I> is specified). If one ormore <I>option-value</I> pairs are specified, then the command modifies the given widgetoption(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 creation command.Read-only options are not be modified.</DD></DL><DL><DT><A NAME="setfocus"><I>pathName</I> <B>setfocus</B></A></DT><DD>Set the focus on the pathname given by <B>-focus</B> option if <B>-state</B> is <I>normal</I>.</DD></DL></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?