home *** CD-ROM | disk | FTP | other *** search
Text File | 2000-03-23 | 92.9 KB | 1,863 lines |
-
- <HTML>
- <HEAD>
- <TITLE>Tk::Text - Create and manipulate Text widgets</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Tk::Text - Create and manipulate Text widgets</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <LI><A HREF="#indices">INDICES</A></LI>
- <LI><A HREF="#tags">TAGS</A></LI>
- <LI><A HREF="#marks">MARKS</A></LI>
- <LI><A HREF="#embedded windows">EMBEDDED WINDOWS</A></LI>
- <LI><A HREF="#embedded images">EMBEDDED IMAGES</A></LI>
- <LI><A HREF="#the selection">THE SELECTION</A></LI>
- <LI><A HREF="#the insertion cursor">THE INSERTION CURSOR</A></LI>
- <LI><A HREF="#widget methods">WIDGET METHODS</A></LI>
- <LI><A HREF="#bindings">BINDINGS</A></LI>
- <LI><A HREF="#performance issues">PERFORMANCE ISSUES</A></LI>
- <LI><A HREF="#see also">SEE ALSO</A></LI>
- <LI><A HREF="#keywords">KEYWORDS</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Tk::Text - Create and manipulate Text widgets</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <P><STRONG>text</STRONG> $text ?<EM>options</EM>?</P>
- <P><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD><STRONG>-background</STRONG><TD><STRONG>-highlightbackground</STRONG><TD><STRONG>-insertontime</STRONG><TD><STRONG>-selectborderwidth</STRONG>
- <TR><TD><STRONG>-borderwidth</STRONG><TD><STRONG>-highlightcolor</STRONG><TD><STRONG>-insertwidth</STRONG><TD><STRONG>-selectforeground</STRONG>
- <TR><TD><STRONG>-cursor</STRONG><TD><STRONG>-highlightthickness</STRONG><TD><STRONG>-padx</STRONG><TD><STRONG>-setgrid</STRONG>
- <TR><TD><STRONG>-exportselection</STRONG><TD><STRONG>-insertbackground</STRONG><TD><STRONG>-pady</STRONG><TD><STRONG>-takefocus</STRONG>
- <TR><TD><STRONG>-font</STRONG><TD><STRONG>-insertborderwidth</STRONG><TD><STRONG>-relief</STRONG><TD><STRONG>-xscrollcommand</STRONG>
- <TR><TD><STRONG>-foreground</STRONG><TD><STRONG>-insertofftime</STRONG><TD><STRONG>-selectbackground</STRONG><TD><STRONG>-yscrollcommand</STRONG></TABLE></P>
- <P>
- <HR>
- <H1><A NAME="widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></H1>
- <DL>
- <DT><STRONG><A NAME="item_Name%3A_height">Name: <STRONG>height</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Height">Class: <STRONG>Height</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dheight">Switch: <STRONG>-height</STRONG></A></STRONG><BR>
- <DD>
- Specifies the desired height for the window, in units of characters
- in the font given by the <STRONG>-font</STRONG> option.
- Must be at least one.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_spacing1">Name: <STRONG>spacing1</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Spacing1">Class: <STRONG>Spacing1</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dspacing1">Switch: <STRONG>-spacing1</STRONG></A></STRONG><BR>
- <DD>
- Requests additional space above each text line in the widget,
- using any of the standard forms for screen distances.
- If a line wraps, this option only applies to the first line
- on the display.
- This option may be overriden with <STRONG>-spacing1</STRONG> options in
- tags.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_spacing2">Name: <STRONG>spacing2</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Spacing2">Class: <STRONG>Spacing2</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dspacing2">Switch: <STRONG>-spacing2</STRONG></A></STRONG><BR>
- <DD>
- For lines that wrap (so that they cover more than one line on the
- display) this option specifies additional space to provide between
- the display lines that represent a single line of text.
- The value may have any of the standard forms for screen distances.
- This option may be overriden with <STRONG>-spacing2</STRONG> options in
- tags.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_spacing3">Name: <STRONG>spacing3</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Spacing3">Class: <STRONG>Spacing3</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dspacing3">Switch: <STRONG>-spacing3</STRONG></A></STRONG><BR>
- <DD>
- Requests additional space below each text line in the widget,
- using any of the standard forms for screen distances.
- If a line wraps, this option only applies to the last line
- on the display.
- This option may be overriden with <STRONG>-spacing3</STRONG> options in
- tags.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_state">Name: <STRONG>state</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_State">Class: <STRONG>State</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dstate">Switch: <STRONG>-state</STRONG></A></STRONG><BR>
- <DD>
- Specifies one of two states for the text: <STRONG>normal</STRONG> or <STRONG>disabled</STRONG>.
- If the text is disabled then characters may not be inserted or deleted
- and no insertion cursor will be displayed, even if the input focus is
- in the widget.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_tabs">Name: <STRONG>tabs</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Tabs">Class: <STRONG>Tabs</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dtabs">Switch: <STRONG>-tabs</STRONG></A></STRONG><BR>
- <DD>
- Specifies a set of tab stops for the window. The option's value consists
- of a list of screen distances giving the positions of the tab stops. Each
- position may optionally be followed in the next list element
- by one of the keywords <STRONG>left</STRONG>, <STRONG>right</STRONG>, <STRONG>center</STRONG>,
- or <STRONG>numeric</STRONG>, which specifies how to justify
- text relative to the tab stop. <STRONG>Left</STRONG> is the default; it causes
- the text following the tab character to be positioned with its left edge
- at the tab position. <STRONG>Right</STRONG> means that the right edge of the text
- following the tab character is positioned at the tab position, and
- <STRONG>center</STRONG> means that the text is centered at the tab position.
- <STRONG>Numeric</STRONG> means that the decimal point in the text is positioned
- at the tab position; if there is no decimal point then the least
- significant digit of the number is positioned just to the left of the
- tab position; if there is no number in the text then the text is
- right-justified at the tab position.
- For example, <STRONG>-tabs => [qw/2c left 4c 6c center/]</STRONG> creates three
- tab stops at two-centimeter intervals; the first two use left
- justification and the third uses center justification.
- If the list of tab stops does not have enough elements to cover all
- of the tabs in a text line, then Tk extrapolates new tab stops using
- the spacing and alignment from the last tab stop in the list.
- The value of the <STRONG>tabs</STRONG> option may be overridden by <STRONG>-tabs</STRONG>
- options in tags.
- If no <STRONG>-tabs</STRONG> option is specified, or if it is specified as
- an empty list, then Tk uses default tabs spaced every eight
- (average size) characters.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_width">Name: <STRONG>width</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Width">Class: <STRONG>Width</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dwidth">Switch: <STRONG>-width</STRONG></A></STRONG><BR>
- <DD>
- Specifies the desired width for the window in units of characters
- in the font given by the <STRONG>-font</STRONG> option.
- If the font doesn't have a uniform width then the width of the
- character ``0'' is used in translating from character units to
- screen units.
- <P></P>
- <DT><STRONG><A NAME="item_Name%3A_wrap">Name: <STRONG>wrap</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Class%3A_Wrap">Class: <STRONG>Wrap</STRONG></A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_Switch%3A_%2Dwrap">Switch: <STRONG>-wrap</STRONG></A></STRONG><BR>
- <DD>
- Specifies how to handle lines in the text that are too long to be
- displayed in a single line of the text's window.
- The value must be <STRONG>none</STRONG> or <STRONG>char</STRONG> or <STRONG>word</STRONG>.
- A wrap mode of <STRONG>none</STRONG> means that each line of text appears as
- exactly one line on the screen; extra characters that don't fit
- on the screen are not displayed.
- In the other modes each line of text will be broken up into several
- screen lines if necessary to keep all the characters visible.
- In <STRONG>char</STRONG> mode a screen line break may occur after any character;
- in <STRONG>word</STRONG> mode a line break will only be made at word boundaries.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>The <STRONG>Text</STRONG> method creates a new window (given by the
- $text argument) and makes it into a text widget.
- Additional
- options, described above, may be specified on the command line
- or in the option database
- to configure aspects of the text such as its default background color
- and relief. The <STRONG>text</STRONG> command returns the
- path name of the new window.</P>
- <P>A text widget displays one or more lines of text and allows that
- text to be edited.
- Text widgets support four different kinds of annotations on the
- text, called tags, marks, embedded windows or embedded images.
- Tags allow different portions of the text
- to be displayed with different fonts and colors.
- In addition, <A HREF="../../../site/lib/Tk/callbacks.html">perl/Tk callbacks</A> can be associated with tags so
- that scripts are invoked when particular actions such as keystrokes
- and mouse button presses occur in particular ranges of the text.
- See <A HREF="#tags">TAGS</A> below for more details.</P>
- <P>The second form of annotation consists of marks, which are floating
- markers in the text.
- Marks are used to keep track of various interesting positions in the
- text as it is edited.
- See <A HREF="#marks">MARKS</A> below for more details.</P>
- <P>The third form of annotation allows arbitrary windows to be
- embedded in a text widget.
- See <A HREF="#embedded windows">EMBEDDED WINDOWS</A> below for more details.</P>
- <P>The fourth form of annotation allows Tk images to be embedded in a text
- widget.
- See <A HREF="#embedded images">EMBEDDED IMAGES</A> below for more details.</P>
- <P>
- <HR>
- <H1><A NAME="indices">INDICES</A></H1>
- <P>Many of the methods for texts take one or more indices
- as arguments.
- An index is a string used to indicate a particular place within
- a text, such as a place to insert characters or one endpoint of a
- range of characters to delete.
- Indices have the syntax</P>
- <PRE>
- base modifier modifier modifier ...</PRE>
- <P>Where <EM>base</EM> gives a starting point and the <EM>modifier</EM>s
- adjust the index from the starting point (e.g. move forward or
- backward one character). Every index must contain a <EM>base</EM>,
- but the <EM>modifier</EM>s are optional.</P>
- <P>The <EM>base</EM> for an index must have one of the following forms:</P>
- <DL>
- <DT><STRONG><A NAME="item_line%2Echar"><EM>line</EM><STRONG>.</STRONG><EM>char</EM></A></STRONG><BR>
- <DD>
- Indicates <EM>char</EM>'th character on line <EM>line</EM>.
- Lines are numbered from 1 for consistency with other UNIX programs
- that use this numbering scheme.
- Within a line, characters are numbered from 0.
- If <EM>char</EM> is <STRONG>end</STRONG> then it refers to the newline character
- that ends the line.
- <P></P>
- <DT><STRONG><A NAME="item_%40x%2Cy"><STRONG>@</STRONG><EM>x</EM><STRONG>,</STRONG><EM>y</EM></A></STRONG><BR>
- <DD>
- Indicates the character that covers the pixel whose x and y coordinates
- within the text's window are <EM>x</EM> and <EM>y</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_end"><STRONG>end</STRONG></A></STRONG><BR>
- <DD>
- Indicates the end of the text (the character just after the last
- newline).
- <P></P>
- <DT><STRONG><A NAME="item_mark"><EM>mark</EM></A></STRONG><BR>
- <DD>
- Indicates the character just after the mark whose name is <EM>mark</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_tag%2Efirst"><EM>tag</EM><STRONG>.first</STRONG></A></STRONG><BR>
- <DD>
- Indicates the first character in the text that has been tagged with
- <EM>tag</EM>.
- This form generates an error if no characters are currently tagged
- with <EM>tag</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_tag%2Elast"><EM>tag</EM><STRONG>.last</STRONG></A></STRONG><BR>
- <DD>
- Indicates the character just after the last one in the text that has
- been tagged with <EM>tag</EM>.
- This form generates an error if no characters are currently tagged
- with <EM>tag</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_%24widget"><EM>$widget</EM></A></STRONG><BR>
- <DD>
- Indicates the position of the embedded window referenced by <EM>$widget</EM>.
- This form generates an error if <EM>$widget</EM> does not reference to an
- embedded window.
- <P></P>
- <DT><STRONG><A NAME="item_imageName"><EM>imageName</EM></A></STRONG><BR>
- <DD>
- Indicates the position of the embedded image whose name is
- <EM>imageName</EM>.
- This form generates an error if there is no embedded image
- by the given name.
- <P>If the <EM>base</EM> could match more than one of the above forms, such
- as a <EM>mark</EM> and <EM>imageName</EM> both having the same value, then
- the form earlier in the above list takes precedence.
- If modifiers follow the base index, each one of them must have one
- of the forms listed below. Keywords such as <STRONG>chars</STRONG> and <STRONG>wordend</STRONG>
- may be abbreviated as long as the abbreviation is unambiguous.</P>
- <P></P>
- <DT><STRONG><A NAME="item_%2B_count_chars"><STRONG>+ </STRONG><EM>count</EM><STRONG> chars</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index forward by <EM>count</EM> characters, moving to later
- lines in the text if necessary. If there are fewer than <EM>count</EM>
- characters in the text after the current index, then set the index
- to the last character in the text.
- Spaces on either side of <EM>count</EM> are optional.
- <P></P>
- <DT><STRONG><A NAME="item_%2D_count_chars"><STRONG>- </STRONG><EM>count</EM><STRONG> chars</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index backward by <EM>count</EM> characters, moving to earlier
- lines in the text if necessary. If there are fewer than <EM>count</EM>
- characters in the text before the current index, then set the index
- to the first character in the text.
- Spaces on either side of <EM>count</EM> are optional.
- <P></P>
- <DT><STRONG><A NAME="item_%2B_count_lines"><STRONG>+ </STRONG><EM>count</EM><STRONG> lines</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index forward by <EM>count</EM> lines, retaining the same
- character position within the line. If there are fewer than <EM>count</EM>
- lines after the line containing the current index, then set the index
- to refer to the same character position on the last line of the text.
- Then, if the line is not long enough to contain a character at the indicated
- character position, adjust the character position to refer to the last
- character of the line (the newline).
- Spaces on either side of <EM>count</EM> are optional.
- <P></P>
- <DT><STRONG><A NAME="item_%2D_count_lines"><STRONG>- </STRONG><EM>count</EM><STRONG> lines</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index backward by <EM>count</EM> lines, retaining the same
- character position within the line. If there are fewer than <EM>count</EM>
- lines before the line containing the current index, then set the index
- to refer to the same character position on the first line of the text.
- Then, if the line is not long enough to contain a character at the indicated
- character position, adjust the character position to refer to the last
- character of the line (the newline).
- Spaces on either side of <EM>count</EM> are optional.
- <P></P>
- <DT><STRONG><A NAME="item_linestart"><STRONG>linestart</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index to refer to the first character on the line.
- <P></P>
- <DT><STRONG><A NAME="item_lineend"><STRONG>lineend</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index to refer to the last character on the line (the newline).
- <P></P>
- <DT><STRONG><A NAME="item_wordstart"><STRONG>wordstart</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index to refer to the first character of the word containing
- the current index. A word consists of any number of adjacent characters
- that are letters, digits, or underscores, or a single character that
- is not one of these.
- <P></P>
- <DT><STRONG><A NAME="item_wordend"><STRONG>wordend</STRONG></A></STRONG><BR>
- <DD>
- Adjust the index to refer to the character just after the last one of the
- word containing the current index. If the current index refers to the last
- character of the text then it is not modified.
- <P>If more than one modifier is present then they are applied in
- left-to-right order. For example, the index ``<STRONG>end - 1 chars</STRONG>''
- refers to the next-to-last character in the text and
- ``<STRONG>insert wordstart - 1 c</STRONG>'' refers to the character just before
- the first one in the word containing the insertion cursor.</P>
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="tags">TAGS</A></H1>
- <P>The first form of annotation in text widgets is a tag.
- A tag is a textual string that is associated with some of the characters
- in a text.
- Tags may contain arbitrary characters, but it is probably best to
- avoid using the the characters `` '' (space), <STRONG>+</STRONG>, or <STRONG>-</STRONG>:
- these characters have special meaning in indices, so tags containing
- them can't be used as indices.
- There may be any number of tags associated with characters in a
- text.
- Each tag may refer to a single character, a range of characters, or
- several ranges of characters.
- An individual character may have any number of tags associated with it.</P>
- <P>A priority order is defined among tags, and this order is used in
- implementing some of the tag-related functions described below.
- When a tag is defined (by associating it with characters or setting
- its display options or binding callbacks to it), it is given
- a priority higher than any existing tag.
- The priority order of tags may be redefined using the
- ``<EM>$text</EM>-><STRONG>tagRaise</STRONG>'' and ``<EM>$text</EM>-><STRONG>tagLower</STRONG>''
- methods.</P>
- <P>Tags serve three purposes in text widgets.
- First, they control the way information is displayed on the screen.
- By default, characters are displayed as determined by the
- <STRONG>background</STRONG>, <STRONG>font</STRONG>, and <STRONG>foreground</STRONG> options for the
- text widget.
- However, display options may be associated with individual tags
- using the ``<EM>$text</EM>-><STRONG>tagConfigure</STRONG>'' method.
- If a character has been tagged, then the display options associated
- with the tag override the default display style.
- The following options are currently supported for tags:</P>
- <DL>
- <DT><STRONG><A NAME="item_%2Dbackground_%3D%3E_color"><STRONG>-background</STRONG> => <EM>color</EM></A></STRONG><BR>
- <DD>
- <EM>Color</EM> specifies the background color to use for characters
- associated with the tag.
- It may have any of the forms accepted by <STRONG>Tk_GetColor</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dbgstipple_%3D%3E_bitmap"><STRONG>-bgstipple</STRONG> => <EM>bitmap</EM></A></STRONG><BR>
- <DD>
- <EM>Bitmap</EM> specifies a bitmap that is used as a stipple pattern
- for the background.
- It may have any of the forms accepted by <STRONG>Tk_GetBitmap</STRONG>.
- If <EM>bitmap</EM> hasn't been specified, or if it is specified
- as an empty string, then a solid fill will be used for the
- background.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dborderwidth_%3D%3E_pixels"><STRONG>-borderwidth</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies the width of a 3-D border to draw around
- the background.
- It may have any of the forms accepted by <STRONG>Tk_GetPixels</STRONG>.
- This option is used in conjunction with the <STRONG>-relief</STRONG>
- option to give a 3-D appearance to the background for characters;
- it is ignored unless the <STRONG>-background</STRONG> option
- has been set for the tag.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfgstipple_%3D%3E_bitmap"><STRONG>-fgstipple</STRONG> => <EM>bitmap</EM></A></STRONG><BR>
- <DD>
- <EM>Bitmap</EM> specifies a bitmap that is used as a stipple pattern
- when drawing text and other foreground information such as
- underlines.
- It may have any of the forms accepted by <STRONG>Tk_GetBitmap</STRONG>.
- If <EM>bitmap</EM> hasn't been specified, or if it is specified
- as an empty string, then a solid fill will be used.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dfont_%3D%3E_fontName"><STRONG>-font</STRONG> => <EM>fontName</EM></A></STRONG><BR>
- <DD>
- <EM>FontName</EM> is the name of a font to use for drawing characters.
- It may have any of the forms accepted by <STRONG>Tk_GetFontStruct</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dforeground_%3D%3E_color"><STRONG>-foreground</STRONG> => <EM>color</EM></A></STRONG><BR>
- <DD>
- <EM>Color</EM> specifies the color to use when drawing text and other
- foreground information such as underlines.
- It may have any of the forms accepted by <STRONG>Tk_GetColor</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Djustify_%3D%3E_justify"><STRONG>-justify</STRONG> => <EM>justify</EM></A></STRONG><BR>
- <DD>
- If the first character of a display line has a tag for which this
- option has been specified, then <EM>justify</EM> determines how to
- justify the line.
- It must be one of <STRONG>left</STRONG>, <STRONG>right</STRONG>, or <STRONG>center</STRONG>.
- If a line wraps, then the justification for each line on the
- display is determined by the first character of that display line.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dlmargin1_%3D%3E_pixels"><STRONG>-lmargin1</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- If the first character of a text line has a tag for which this
- option has been specified, then <EM>pixels</EM> specifies how
- much the line should be indented from the left edge of the
- window.
- <EM>Pixels</EM> may have any of the standard forms for screen
- distances.
- If a line of text wraps, this option only applies to the
- first line on the display; the <STRONG>-lmargin2</STRONG> option controls
- the indentation for subsequent lines.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dlmargin2_%3D%3E_pixels"><STRONG>-lmargin2</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- If the first character of a display line has a tag for which this
- option has been specified, and if the display line is not the
- first for its text line (i.e., the text line has wrapped), then
- <EM>pixels</EM> specifies how much the line should be indented from
- the left edge of the window.
- <EM>Pixels</EM> may have any of the standard forms for screen
- distances.
- This option is only used when wrapping is enabled, and it only
- applies to the second and later display lines for a text line.
- <P></P>
- <DT><STRONG><A NAME="item_%2Doffset_%3D%3E_pixels"><STRONG>-offset</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies an amount by which the text's baseline
- should be offset vertically from the baseline of the overall
- line, in pixels.
- For example, a positive offset can be used for superscripts
- and a negative offset can be used for subscripts.
- <EM>Pixels</EM> may have any of the standard forms for screen
- distances.
- <P></P>
- <DT><STRONG><A NAME="item_%2Doverstrike_%3D%3E_boolean"><STRONG>-overstrike</STRONG> => <EM>boolean</EM></A></STRONG><BR>
- <DD>
- Specifies whether or not to draw a horizontal rule through
- the middle of characters.
- <EM>Boolean</EM> may have any of the forms accepted by <STRONG>Tk_GetBoolean</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Drelief_%3D%3E_relief"><STRONG>-relief</STRONG> => <EM>relief</EM></A></STRONG><BR>
- <DD>
- <EM>Relief</EM> specifies the 3-D relief to use for drawing backgrounds,
- in any of the forms accepted by <STRONG>Tk_GetRelief</STRONG>.
- This option is used in conjunction with the <STRONG>-borderwidth</STRONG>
- option to give a 3-D appearance to the background for characters;
- it is ignored unless the <STRONG>-background</STRONG> option
- has been set for the tag.
- <P></P>
- <DT><STRONG><A NAME="item_%2Drmargin_%3D%3E_pixels"><STRONG>-rmargin</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- If the first character of a display line has a tag for which this
- option has been specified, then <EM>pixels</EM> specifies how wide
- a margin to leave between the end of the line and the right
- edge of the window.
- <EM>Pixels</EM> may have any of the standard forms for screen
- distances.
- This option is only used when wrapping is enabled.
- If a text line wraps, the right margin for each line on the
- display is determined by the first character of that display
- line.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dspacing1_%3D%3E_pixels"><STRONG>-spacing1</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies how much additional space should be
- left above each text line, using any of the standard forms for
- screen distances.
- If a line wraps, this option only applies to the first
- line on the display.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dspacing2_%3D%3E_pixels"><STRONG>-spacing2</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- For lines that wrap, this option specifies how much additional
- space to leave between the display lines for a single text line.
- <EM>Pixels</EM> may have any of the standard forms for screen
- distances.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dspacing3_%3D%3E_pixels"><STRONG>-spacing3</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies how much additional space should be
- left below each text line, using any of the standard forms for
- screen distances.
- If a line wraps, this option only applies to the last
- line on the display.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dstate_%3D%3E_state"><STRONG>-state</STRONG> => <EM>state</EM></A></STRONG><BR>
- <DD>
- <EM>State</EM> specifies if the text is <EM>hidden</EM> or <EM>normal</EM>.
- Hidden text is not displayed and takes no space on screen, but further
- on behaves just as normal text.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dtabs_%3D%3E_tabList"><STRONG>-tabs</STRONG> => <EM>tabList</EM></A></STRONG><BR>
- <DD>
- <EM>TabList</EM> specifies a set of tab stops in the same form
- as for the <STRONG>-tabs</STRONG> option for the text widget. This
- option only applies to a display line if it applies to the
- first character on that display line.
- If this option is specified as an empty string, it cancels
- the option, leaving it unspecified for the tag (the default).
- If the option is specified as a non-empty string that is
- an empty list, such as <STRONG>-tabs =</STRONG> `` ''>, then it requests
- default 8-character tabs as described for the <STRONG>tabs</STRONG>
- widget option.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dunderline_%3D%3E_boolean"><STRONG>-underline</STRONG> => <EM>boolean</EM></A></STRONG><BR>
- <DD>
- <EM>Boolean</EM> specifies whether or not to draw an underline underneath
- characters.
- It may have any of the forms accepted by <STRONG>Tk_GetBoolean</STRONG>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dwrap_%3D%3E_mode"><STRONG>-wrap</STRONG> => <EM>mode</EM></A></STRONG><BR>
- <DD>
- <EM>Mode</EM> specifies how to handle lines that are wider than the
- text's window.
- It has the same legal values as the <STRONG>-wrap</STRONG> option
- for the text widget: <STRONG>none</STRONG>, <STRONG>char</STRONG>, or <STRONG>word</STRONG>.
- If this tag option is specified, it overrides the <STRONG>-wrap</STRONG> option
- for the text widget.
- <P></P>
- <DT><STRONG><A NAME="item_%2Delide_%3D%3E_value"><STRONG>-elide</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- If value is true then text covered by the tag is not displayed.
- <P></P>
- <DT><STRONG><A NAME="item_%2Ddata_%3D%3E_value"><STRONG>-data</STRONG> => <EM>value</EM></A></STRONG><BR>
- <DD>
- Allows an arbitrary perl scalar <EM>value</EM> to be associated with the tag.
- <P></P></DL>
- <P>If a character has several tags associated with it, and if their
- display options conflict, then the options of the highest priority
- tag are used.
- If a particular display option hasn't been specified for a
- particular tag, or if it is specified as an empty string, then
- that option will never be used; the next-highest-priority
- tag's option will used instead.
- If no tag specifies a particular display option, then the default
- style for the widget will be used.</P>
- <P>The second purpose for tags is event bindings.
- You can associate bindings with a tag in much the same way you can
- associate bindings with a widget class: whenever particular X
- events occur on characters with the given tag, a given
- <perl/Tk callback|Tk::callbacks> will be executed.
- Tag bindings can be used to give behaviors to ranges of characters;
- among other things, this allows hypertext-like
- features to be implemented.
- For details, see the description of the <STRONG>tagBind</STRONG> widget
- method below.</P>
- <P>The third use for tags is in managing the selection.
- See <A HREF="#the selection">THE SELECTION</A> below.</P>
- <P>
- <HR>
- <H1><A NAME="marks">MARKS</A></H1>
- <P>The second form of annotation in text widgets is a mark.
- Marks are used for remembering particular places in a text.
- They are something like tags, in that they have names and
- they refer to places in the file, but a mark isn't associated
- with particular characters.
- Instead, a mark is associated with the gap between two characters.
- Only a single position may be associated with a mark at any given
- time.
- If the characters around a mark are deleted the mark will still
- remain; it will just have new neighbor characters.
- In contrast, if the characters containing a tag are deleted then
- the tag will no longer have an association with characters in
- the file.
- Marks may be manipulated with the ``<EM>$text</EM>-><STRONG>mark</STRONG>'' text widget
- method, and their current locations may be determined by using the
- mark name as an index in methods.</P>
- <P>Each mark also has a <EM>gravity</EM>, which is either <STRONG>left</STRONG> or
- <STRONG>right</STRONG>.
- The gravity for a mark specifies what happens to the mark when
- text is inserted at the point of the mark.
- If a mark has left gravity, then the mark is treated as if it
- were attached to the character on its left, so the mark will
- remain to the left of any text inserted at the mark position.
- If the mark has right gravity, new text inserted at the mark
- position will appear to the right of the mark. The gravity
- for a mark defaults to <STRONG>right</STRONG>.</P>
- <P>The name space for marks is different from that for tags: the
- same name may be used for both a mark and a tag, but they will refer
- to different things.</P>
- <P>Two marks have special significance.
- First, the mark <STRONG>insert</STRONG> is associated with the insertion cursor,
- as described under <A HREF="#the insertion cursor">THE INSERTION CURSOR</A> below.
- Second, the mark <STRONG>current</STRONG> is associated with the character
- closest to the mouse and is adjusted automatically to track the
- mouse position and any changes to the text in the widget (one
- exception: <STRONG>current</STRONG> is not updated in response to mouse
- motions if a mouse button is down; the update will be deferred
- until all mouse buttons have been released).
- Neither of these special marks may be deleted.</P>
- <P>
- <HR>
- <H1><A NAME="embedded windows">EMBEDDED WINDOWS</A></H1>
- <P>The third form of annotation in text widgets is an embedded window.
- Each embedded window annotation causes a window to be displayed
- at a particular point in the text.
- There may be any number of embedded windows in a text widget,
- and any widget may be used as an embedded window (subject to the
- usual rules for geometry management, which require the text window
- to be the parent of the embedded window or a descendant of its
- parent).
- The embedded window's position on the screen will be updated as the
- text is modified or scrolled, and it will be mapped and unmapped as
- it moves into and out of the visible area of the text widget.
- Each embedded window occupies one character's worth of index space
- in the text widget, and it may be referred to either by the name
- of its embedded window or by its position in the widget's
- index space.
- If the range of text containing the embedded window is deleted then
- the window is destroyed.</P>
- <P>When an embedded window is added to a text widget with the
- <STRONG>widgetCreate</STRONG> method, several configuration
- options may be associated with it.
- These options may be modified later with the <STRONG>widgetConfigure</STRONG>
- method.
- The following options are currently supported:</P>
- <DL>
- <DT><STRONG><A NAME="item_%2Dalign_%3D%3E_where"><STRONG>-align</STRONG> => <EM>where</EM></A></STRONG><BR>
- <DD>
- If the window is not as tall as the line in which it is displayed,
- this option determines where the window is displayed in the line.
- <EM>Where</EM> must have one of the values <STRONG>top</STRONG> (align the top of the window
- with the top of the line), <STRONG>center</STRONG> (center the window
- within the range of the line), <STRONG>bottom</STRONG> (align the bottom of the
- window with the bottom of the line's area),
- or <STRONG>baseline</STRONG> (align the bottom of the window with the baseline
- of the line).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dcreate_%3D%3E_callback"><STRONG>-create</STRONG> => <EM>callback</EM></A></STRONG><BR>
- <DD>
- Specifies a <A HREF="../../../site/lib/Tk/callbacks.html">callback</A> that may be evaluated to create the window
- for the annotation.
- If no <STRONG>-window</STRONG> option has been specified for the annotation
- this <EM>callback</EM> will be evaluated when the annotation is about to
- be displayed on the screen.
- <EM>Callback</EM> must create a window for the annotation and return
- the name of that window as its result.
- If the annotation's window should ever be deleted, <EM>callback</EM>
- will be evaluated again the next time the annotation is displayed.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dpadx_%3D%3E_pixels"><STRONG>-padx</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies the amount of extra space to leave on
- each side of the embedded window.
- It may have any of the usual forms defined for a screen distance
- (see <STRONG>Tk_GetPixels</STRONG>).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dpady_%3D%3E_pixels"><STRONG>-pady</STRONG> => <EM>pixels</EM></A></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies the amount of extra space to leave on
- the top and on the bottom of the embedded window.
- It may have any of the usual forms defined for a screen distance
- (see <STRONG>Tk_GetPixels</STRONG>).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dstretch_%3D%3E_boolean"><STRONG>-stretch</STRONG> => <EM>boolean</EM></A></STRONG><BR>
- <DD>
- If the requested height of the embedded window is less than the
- height of the line in which it is displayed, this option can be
- used to specify whether the window should be stretched vertically
- to fill its line.
- If the <STRONG>-pady</STRONG> option has been specified as well, then the
- requested padding will be retained even if the window is
- stretched.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dwindow_%3D%3E_%24widget"><STRONG>-window</STRONG> => <EM>$widget</EM></A></STRONG><BR>
- <DD>
- Specifies the name of a window to display in the annotation.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="embedded images">EMBEDDED IMAGES</A></H1>
- <P>The final form of annotation in text widgets is an embedded image.
- Each embedded image annotation causes an image to be displayed
- at a particular point in the text.
- There may be any number of embedded images in a text widget,
- and a particular image may be embedded in multiple places in the same
- text widget.
- The embedded image's position on the screen will be updated as the
- text is modified or scrolled.
- Each embedded image occupies one character's worth of index space
- in the text widget, and it may be referred to either by
- its position in the widget's index space, or the name it is assigned
- when the image is inserted into the text widget with <STRONG>imageCreate</STRONG>.
- If the range of text containing the embedded image is deleted then
- that copy of the image is removed from the screen.</P>
- <P>When an embedded image is added to a text widget with the <STRONG>image</STRONG>
- create method, a name unique to this instance of the image
- is returned. This name may then be used to refer to this image
- instance. The name is taken to be the value of the <STRONG>-name</STRONG> option
- (described below). If the <STRONG>-name</STRONG> option is not provided, the
- <STRONG>-image</STRONG> name is used instead. If the <EM>imageName</EM> is already
- in use in the text widget, then <STRONG>#</STRONG><EM>nn</EM> is added to the end of the
- <EM>imageName</EM>, where <EM>nn</EM> is an arbitrary integer. This insures
- the <EM>imageName</EM> is unique.
- Once this name is assigned to this instance of the image, it does not
- change, even though the <STRONG>-image</STRONG> or <STRONG>-name</STRONG> values can be changed
- with <STRONG>image configure</STRONG>.</P>
- <P>When an embedded image is added to a text widget with the
- <STRONG>imageCreate</STRONG> method, several configuration
- options may be associated with it.
- These options may be modified later with the <STRONG>image configure</STRONG>
- method.
- The following options are currently supported:</P>
- <DL>
- <DT><STRONG><STRONG>-align</STRONG> => <EM>where</EM></STRONG><BR>
- <DD>
- If the image is not as tall as the line in which it is displayed,
- this option determines where the image is displayed in the line.
- <EM>Where</EM> must have one of the values <STRONG>top</STRONG> (align the top of the image
- with the top of the line), <STRONG>center</STRONG> (center the image
- within the range of the line), <STRONG>bottom</STRONG> (align the bottom of the
- image with the bottom of the line's area),
- or <STRONG>baseline</STRONG> (align the bottom of the image with the baseline
- of the line).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dimage_%3D%3E_image"><STRONG>-image</STRONG> => <EM>image</EM></A></STRONG><BR>
- <DD>
- Specifies the name of the Tk image to display in the annotation.
- If <EM>image</EM> is not a valid Tk image, then an error is returned.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dname_%3D%3E_ImageName"><STRONG>-name</STRONG> => <EM>ImageName</EM></A></STRONG><BR>
- <DD>
- Specifies the name by which this image instance may be referenced in
- the text widget. If <EM>ImageName</EM> is not supplied, then the
- name of the Tk image is used instead.
- If the <EM>imageName</EM> is already in use, <EM>#nn</EM> is appended to
- the end of the name as described above.
- <P></P>
- <DT><STRONG><STRONG>-padx</STRONG> => <EM>pixels</EM></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies the amount of extra space to leave on
- each side of the embedded image.
- It may have any of the usual forms defined for a screen distance.
- <P></P>
- <DT><STRONG><STRONG>-pady</STRONG> => <EM>pixels</EM></STRONG><BR>
- <DD>
- <EM>Pixels</EM> specifies the amount of extra space to leave on
- the top and on the bottom of the embedded image.
- It may have any of the usual forms defined for a screen distance.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="the selection">THE SELECTION</A></H1>
- <P>Selection support is implemented via tags.
- If the <STRONG>exportSelection</STRONG> option for the text widget is true
- then the <STRONG>sel</STRONG> tag will be associated with the selection:</P>
- <DL>
- <DT><STRONG><A NAME="item_%5B1%5D">[1]</A></STRONG><BR>
- <DD>
- Whenever characters are tagged with <STRONG>sel</STRONG> the text widget
- will claim ownership of the selection.
- <P></P>
- <DT><STRONG><A NAME="item_%5B2%5D">[2]</A></STRONG><BR>
- <DD>
- Attempts to retrieve the
- selection will be serviced by the text widget, returning all the
- characters with the <STRONG>sel</STRONG> tag.
- <P></P>
- <DT><STRONG><A NAME="item_%5B3%5D">[3]</A></STRONG><BR>
- <DD>
- If the selection is claimed away by another application or by another
- window within this application, then the <STRONG>sel</STRONG> tag will be removed
- from all characters in the text.
- <P>The <STRONG>sel</STRONG> tag is automatically defined when a text widget is
- created, and it may not be deleted with the ``<EM>$text</EM>-><STRONG>tagDelete</STRONG>''
- method. Furthermore, the <STRONG>selectBackground</STRONG>,
- <STRONG>selectBorderWidth</STRONG>, and <STRONG>selectForeground</STRONG> options for
- the text widget are tied to the <STRONG>-background</STRONG>,
- <STRONG>-borderwidth</STRONG>, and <STRONG>-foreground</STRONG> options for the <STRONG>sel</STRONG>
- tag: changes in either will automatically be reflected in the
- other.</P>
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="the insertion cursor">THE INSERTION CURSOR</A></H1>
- <P>The mark named <STRONG>insert</STRONG> has special significance in text widgets.
- It is defined automatically when a text widget is created and it
- may not be unset with the ``<EM>$text</EM>-><STRONG>markUnset</STRONG>'' widget
- command.
- The <STRONG>insert</STRONG> mark represents the position of the insertion
- cursor, and the insertion cursor will automatically be drawn at
- this point whenever the text widget has the input focus.</P>
- <P>
- <HR>
- <H1><A NAME="widget methods">WIDGET METHODS</A></H1>
- <P>The <STRONG>Text</STRONG> method creates a widget object.
- This object supports the <STRONG>configure</STRONG> and <STRONG>cget</STRONG> methods
- described in <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> which can be used to enquire and
- modify the options described above.
- The widget also inherits all the methods provided by the generic
- <A HREF="../../../site/lib/Tk/Widget.html">Tk::Widget</A> class.</P>
- <P>The following additional methods are available for text widgets:</P>
- <DL>
- <DT><STRONG><A NAME="item_bbox"><EM>$text</EM>-><STRONG>bbox</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns a list of four elements describing the screen area
- of the character given by <EM>index</EM>.
- The first two elements of the list give the x and y coordinates
- of the upper-left corner of the area occupied by the
- character, and the last two elements give the width and height
- of the area.
- If the character is only partially visible on the screen, then
- the return value reflects just the visible part.
- If the character is not visible on the screen then the return
- value is an empty list.
- <P></P>
- <DT><STRONG><A NAME="item_compare"><EM>$text</EM>-><STRONG>compare</STRONG>(<EM>index1, op, index2</EM>)</A></STRONG><BR>
- <DD>
- Compares the indices given by <EM>index1</EM> and <EM>index2</EM> according
- to the relational operator given by <EM>op</EM>, and returns 1 if
- the relationship is satisfied and 0 if it isn't.
- <EM>Op</EM> must be one of the operators <, <=, ==, >=, >, or !=.
- If <EM>op</EM> is == then 1 is returned if the two indices refer to
- the same character, if <EM>op</EM> is < then 1 is returned if <EM>index1</EM>
- refers to an earlier character in the text than <EM>index2</EM>, and
- so on.
- <P></P>
- <DT><STRONG><A NAME="item_debug"><EM>$text</EM>-><STRONG>debug</STRONG>(?<EM>boolean</EM>?)</A></STRONG><BR>
- <DD>
- If <EM>boolean</EM> is specified, then it must have one of the true or
- false values accepted by Tcl_GetBoolean.
- If the value is a true one then internal consistency checks will be
- turned on in the B-tree code associated with text widgets.
- If <EM>boolean</EM> has a false value then the debugging checks will
- be turned off.
- In either case the command returns an empty string.
- If <EM>boolean</EM> is not specified then the command returns <STRONG>on</STRONG>
- or <STRONG>off</STRONG> to indicate whether or not debugging is turned on.
- There is a single debugging switch shared by all text widgets: turning
- debugging on or off in any widget turns it on or off for all widgets.
- For widgets with large amounts of text, the consistency checks may
- cause a noticeable slow-down.
- <P></P>
- <DT><STRONG><A NAME="item_delete"><EM>$text</EM>-><STRONG>delete</STRONG>(<EM>index1, </EM>?<EM>index2</EM>?)</A></STRONG><BR>
- <DD>
- Delete a range of characters from the text.
- If both <EM>index1</EM> and <EM>index2</EM> are specified, then delete
- all the characters starting with the one given by <EM>index1</EM>
- and stopping just before <EM>index2</EM> (i.e. the character at
- <EM>index2</EM> is not deleted).
- If <EM>index2</EM> doesn't specify a position later in the text
- than <EM>index1</EM> then no characters are deleted.
- If <EM>index2</EM> isn't specified then the single character at
- <EM>index1</EM> is deleted.
- It is not allowable to delete characters in a way that would leave
- the text without a newline as the last character.
- The command returns an empty string.
- <P></P>
- <DT><STRONG><A NAME="item_dlineinfo"><EM>$text</EM>-><STRONG>dlineinfo</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns a list with five elements describing the area occupied
- by the display line containing <EM>index</EM>.
- The first two elements of the list give the x and y coordinates
- of the upper-left corner of the area occupied by the
- line, the third and fourth elements give the width and height
- of the area, and the fifth element gives the position of the baseline
- for the line, measured down from the top of the area.
- All of this information is measured in pixels.
- If the current wrap mode is <STRONG>none</STRONG> and the line extends beyond
- the boundaries of the window,
- the area returned reflects the entire area of the line, including the
- portions that are out of the window.
- If the line is shorter than the full width of the window then the
- area returned reflects just the portion of the line that is occupied
- by characters and embedded windows.
- If the display line containing <EM>index</EM> is not visible on
- the screen then the return value is an empty list.
- <P></P>
- <DT><STRONG><A NAME="item_dump"><EM>$text</EM>-><STRONG>dump</STRONG>(?<EM>switches</EM>?, <EM>index1, </EM>?<EM>index2</EM>?)</A></STRONG><BR>
- <DD>
- Return the contents of the text widget from <EM>index1</EM> up to,
- but not including <EM>index2</EM>,
- including the text and
- information about marks, tags, and embedded windows.
- If <EM>index2</EM> is not specified, then it defaults to
- one character past <EM>index1</EM>. The information is returned
- in the following format:
- <P><EM>key1 value1 index1 key2 value2 index2</EM> ...</P>
- <P></P></DL>
- <P>The possible <EM>key</EM> values are <STRONG>text</STRONG>, <STRONG>mark</STRONG>,
- <STRONG>tagon</STRONG>, <STRONG>tagoff</STRONG>, and <EM>$text</EM>. The corresponding
- <EM>value</EM> is the text, mark name, tag name, or window name.
- The <EM>index</EM> information is the index of the
- start of the text, the mark, the tag transition, or the window.
- One or more of the following switches (or abbreviations thereof)
- may be specified to control the dump:</P>
- <DL>
- <DT><STRONG><A NAME="item_%2Dall"><STRONG>-all</STRONG></A></STRONG><BR>
- <DD>
- Return information about all elements: text, marks, tags, and windows.
- This is the default.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dcommand_%3D%3E_callback"><STRONG>-command</STRONG> => <EM>callback</EM></A></STRONG><BR>
- <DD>
- Instead of returning the information as the result of the dump operation,
- invoke the <EM>callback</EM> on each element of the text widget within the range.
- The callback has three arguments appended to it before it is evaluated:
- the <EM>key</EM>, <EM>value</EM>, and <EM>index</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dmark"><STRONG>-mark</STRONG></A></STRONG><BR>
- <DD>
- Include information about marks in the dump results.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dtag"><STRONG>-tag</STRONG></A></STRONG><BR>
- <DD>
- Include information about tag transitions in the dump results. Tag information is
- returned as <STRONG>tagon</STRONG> and <STRONG>tagoff</STRONG> elements that indicate the
- begin and end of each range of each tag, respectively.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dtext"><STRONG>-text</STRONG></A></STRONG><BR>
- <DD>
- Include information about text in the dump results. The value is the
- text up to the next element or the end of range indicated by <EM>index2</EM>.
- A text element does not span newlines. A multi-line block of text that
- contains no marks or tag transitions will still be dumped as a set
- of text seqments that each end with a newline. The newline is part
- of the value.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dwindow"><STRONG>-window</STRONG></A></STRONG><BR>
- <DD>
- Include information about embedded windows in the dump results.
- The value of a window is its Tk pathname, unless the window
- has not been created yet. (It must have a create script.)
- In this case an empty string is returned, and you must query the
- window by its index position to get more information.
- <P></P>
- <DT><STRONG><A NAME="item_get"><EM>$text</EM>-><STRONG>get</STRONG>(<EM>index1, </EM>?<EM>index2</EM>?)</A></STRONG><BR>
- <DD>
- Return a range of characters from the text.
- The return value will be all the characters in the text starting
- with the one whose index is <EM>index1</EM> and ending just before
- the one whose index is <EM>index2</EM> (the character at <EM>index2</EM>
- will not be returned).
- If <EM>index2</EM> is omitted then the single character at <EM>index1</EM>
- is returned.
- If there are no characters in the specified range (e.g. <EM>index1</EM>
- is past the end of the file or <EM>index2</EM> is less than or equal
- to <EM>index1</EM>) then an empty string is returned.
- If the specified range contains embedded windows, no information
- about them is included in the returned string.
- <P></P>
- <DT><STRONG><A NAME="item_image"><EM>$text</EM>-><STRONG>image</STRONG>(<EM>option</EM>, ?<EM>arg, arg, ...</EM>?)</A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_imageOption"><EM>$text</EM>-><STRONG>image</STRONG><EM>Option</EM>(?<EM>arg, arg, ...</EM>?)</A></STRONG><BR>
- <DD>
- This method is used to manipulate embedded images.
- The behavior of the method depends on the <EM>option</EM> argument
- that follows the <STRONG>image</STRONG> prefix.
- The following forms of the methods are currently supported:
- <DL>
- <DT><STRONG><A NAME="item_imageCget"><EM>$text</EM>-><STRONG>imageCget</STRONG>(<EM>index, option</EM>)</A></STRONG><BR>
- <DD>
- Returns the value of a configuration option for an embedded image.
- <EM>Index</EM> identifies the embedded image, and <EM>option</EM>
- specifies a particular configuration option, which must be one of
- the ones listed in <A HREF="#embedded images">EMBEDDED IMAGES</A>.
- <P></P>
- <DT><STRONG><A NAME="item_imageConfigure"><EM>$text</EM>-><STRONG>imageConfigure</STRONG>(<EM>index, </EM>?<EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- Query or modify the configuration options for an embedded image.
- If no <EM>option</EM> is specified, returns a list describing all of
- the available options for the embedded image at <EM>index</EM>
- (see <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this list).
- If <EM>option</EM> is specified with no <EM>value</EM>, 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
- <EM>option</EM> is specified).
- If one or more <EM>option-value</EM> pairs are specified, then the command
- modifies the given <CODE>option(s)</CODE> to have the given value(s); in
- this case the command returns an empty string.
- See <A HREF="#embedded images">EMBEDDED IMAGES</A> for information on the options that
- are supported.
- <P></P>
- <DT><STRONG><A NAME="item_imageCreate"><EM>$text</EM>-><STRONG>imageCreate</STRONG>(<EM>index, </EM>?<EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- This command creates a new image annotation, which will appear
- in the text at the position given by <EM>index</EM>.
- Any number of <EM>option-value</EM> pairs may be specified to
- configure the annotation.
- Returns a unique identifier that may be used as an index to refer to
- this image.
- See <A HREF="#embedded images">EMBEDDED IMAGES</A> for information on the options that
- are supported, and a description of the identifier returned.
- <P></P>
- <DT><STRONG><A NAME="item_imageNames"><EM>$text</EM>-><STRONG>imageNames</STRONG></A></STRONG><BR>
- <DD>
- Returns a list whose elements are the names of all image instances currently
- embedded in $text.
- <P></P></DL>
- <DT><STRONG><A NAME="item_index"><EM>$text</EM>-><STRONG>index</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns the position corresponding to <EM>index</EM> in the form
- <EM>line.char</EM> where <EM>line</EM> is the line number and <EM>char</EM>
- is the character number.
- <EM>Index</EM> may have any of the forms described under <A HREF="#indices">INDICES</A> above.
- <P></P>
- <DT><STRONG><A NAME="item_insert"><EM>$text</EM>-><STRONG>insert</STRONG>(<EM>index, chars, </EM>?<EM>tagList, chars, tagList, ...</EM>?)</A></STRONG><BR>
- <DD>
- Inserts all of the <EM>chars</EM> arguments just before the character at
- <EM>index</EM>.
- If <EM>index</EM> refers to the end of the text (the character after
- the last newline) then the new text is inserted just before the
- last newline instead.
- If there is a single <EM>chars</EM> argument and no <EM>tagList</EM>, then
- the new text will receive any tags that are present on both the
- character before and the character after the insertion point; if a tag
- is present on only one of these characters then it will not be
- applied to the new text.
- If <EM>tagList</EM> is specified then it consists of a list of
- tag names; the new characters will receive all of the tags in
- this list and no others, regardless of the tags present around
- the insertion point.
- If multiple <EM>chars</EM>-<EM>tagList</EM> argument pairs are present,
- they produce the same effect as if a separate <STRONG>insert</STRONG> widget
- command had been issued for each pair, in order.
- The last <EM>tagList</EM> argument may be omitted.
- <P></P>
- <DT><STRONG><EM>$text</EM>-><STRONG>mark</STRONG>(<EM>option, </EM>?<EM>arg, arg, ...</EM>?)</STRONG><BR>
- <DD>
- This command is used to manipulate marks. The exact behavior of
- the command depends on the <EM>option</EM> argument that follows
- the <STRONG>mark</STRONG> argument. The following forms of the command
- are currently supported:
- <DL>
- <DT><STRONG><A NAME="item_markGravity"><EM>$text</EM>-><STRONG>markGravity</STRONG>(<EM>markName, </EM>?<EM>direction</EM>?)</A></STRONG><BR>
- <DD>
- If <EM>direction</EM> is not specified, returns <STRONG>left</STRONG> or <STRONG>right</STRONG>
- to indicate which of its adjacent characters <EM>markName</EM> is attached
- to.
- If <EM>direction</EM> is specified, it must be <STRONG>left</STRONG> or <STRONG>right</STRONG>;
- the gravity of <EM>markName</EM> is set to the given value.
- <P></P>
- <DT><STRONG><A NAME="item_markNames"><EM>$text</EM>-><STRONG>markNames</STRONG></A></STRONG><BR>
- <DD>
- Returns a list whose elements are the names of all the marks that
- are currently set.
- <P></P>
- <DT><STRONG><A NAME="item_markNext"><EM>$text</EM>-><STRONG>markNext</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns the name of the next mark at or after <EM>index</EM>.
- If <EM>index</EM> is specified in numerical form, then the search for
- the next mark begins at that index.
- If <EM>index</EM> is the name of a mark, then the search for
- the next mark begins immediately after that mark.
- This can still return a mark at the same position if
- there are multiple marks at the same index.
- These semantics mean that the <STRONG>mark next</STRONG> operation can be used to
- step through all the marks in a text widget in the same order
- as the mark information returned by the <STRONG>dump</STRONG> operation.
- If a mark has been set to the special <STRONG>end</STRONG> index,
- then it appears to be <EM>after</EM> <STRONG>end</STRONG> with respect to the <STRONG>mark next</STRONG> operation.
- An empty string is returned if there are no marks after <EM>index</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_markPrevious"><EM>$text</EM>-><STRONG>markPrevious</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Returns the name of the mark at or before <EM>index</EM>.
- If <EM>index</EM> is specified in numerical form, then the search for
- the previous mark begins with the character just before that index.
- If <EM>index</EM> is the name of a mark, then the search for
- the next mark begins immediately before that mark.
- This can still return a mark at the same position if
- there are multiple marks at the same index.
- These semantics mean that the <STRONG>mark previous</STRONG> operation can be used to
- step through all the marks in a text widget in the reverse order
- as the mark information returned by the <STRONG>dump</STRONG> operation.
- An empty string is returned if there are no marks before <EM>index</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_markSet"><EM>$text</EM>-><STRONG>markSet</STRONG>(<EM>markName, index</EM>)</A></STRONG><BR>
- <DD>
- Sets the mark named <EM>markName</EM> to a position just before the
- character at <EM>index</EM>.
- If <EM>markName</EM> already exists, it is moved from its old position;
- if it doesn't exist, a new mark is created.
- This command returns an empty string.
- <P></P>
- <DT><STRONG><A NAME="item_markUnset"><EM>$text</EM>-><STRONG>markUnset</STRONG>(<EM>markName</EM>?, <EM>markName, markName, ...</EM>?)</A></STRONG><BR>
- <DD>
- Remove the mark corresponding to each of the <EM>markName</EM> arguments.
- The removed marks will not be usable in indices and will not be
- returned by future calls to ``<EM>$text</EM>-><STRONG>markNames</STRONG>''.
- This command returns an empty string.
- <P></P></DL>
- <DT><STRONG><A NAME="item_scan"><EM>$text</EM>-><STRONG>scan</STRONG>(<EM>option</EM>, <EM>args</EM>) or</A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_scanoption"><EM>$text</EM>-><STRONG>scan</STRONG><EM>option</EM>(<EM>args</EM>)</A></STRONG><BR>
- <DD>
- This method is used to implement scanning on texts. It has
- two forms, depending on <EM>option</EM>:
- <DL>
- <DT><STRONG><A NAME="item_scanMark"><EM>$text</EM>-><STRONG>scanMark</STRONG>(<EM>x, y</EM>)</A></STRONG><BR>
- <DD>
- Records <EM>x</EM> and <EM>y</EM> and the current view in the text window,
- for use in conjunction with later <STRONG>scanDragto</STRONG> method.
- Typically this method is associated with a mouse button press in
- the widget. It returns an empty string.
- <P></P>
- <DT><STRONG><A NAME="item_scanDragto"><EM>$text</EM>-><STRONG>scanDragto</STRONG>(<EM>x, y</EM>)</A></STRONG><BR>
- <DD>
- This command computes the difference between its <EM>x</EM> and <EM>y</EM>
- arguments and the <EM>x</EM> and <EM>y</EM> arguments to the last
- <STRONG>scanMark</STRONG> method for the widget.
- It then adjusts the view by 10 times the difference in coordinates.
- This command is typically associated
- with mouse motion events in the widget, to produce the effect of
- dragging the text at high speed through the window. The return
- value is an empty string.
- <P></P></DL>
- <DT><STRONG><A NAME="item_search"><EM>$text</EM>-><STRONG>search</STRONG>(?<EM>switches</EM>,? <EM>pattern, index, </EM>?<EM>stopIndex</EM>?)</A></STRONG><BR>
- <DD>
- Searches the text in <EM>$text</EM> starting at <EM>index</EM> for a range
- of characters that matches <EM>pattern</EM>.
- If a match is found, the index of the first character in the match is
- returned as result; otherwise an empty string is returned.
- One or more of the following switches (or abbreviations thereof)
- may be specified to control the search:
- <DL>
- <DT><STRONG><A NAME="item_%2Dforwards"><STRONG>-forwards</STRONG></A></STRONG><BR>
- <DD>
- The search will proceed forward through the text, finding the first
- matching range starting at or after the position given by <EM>index</EM>.
- This is the default.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dbackwards"><STRONG>-backwards</STRONG></A></STRONG><BR>
- <DD>
- The search will proceed backward through the text, finding the
- matching range closest to <EM>index</EM> whose first character
- is before <EM>index</EM>.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dexact"><STRONG>-exact</STRONG></A></STRONG><BR>
- <DD>
- Use exact matching: the characters in the matching range must be
- identical to those in <EM>pattern</EM>.
- This is the default.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dregexp"><STRONG>-regexp</STRONG></A></STRONG><BR>
- <DD>
- Treat <EM>pattern</EM> as a regular expression and match it against
- the text using the rules for regular expressions (see the <STRONG>regexp</STRONG>
- command for details).
- <P></P>
- <DT><STRONG><A NAME="item_%2Dnocase"><STRONG>-nocase</STRONG></A></STRONG><BR>
- <DD>
- Ignore case differences between the pattern and the text.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dcount_varName"><STRONG>-count</STRONG><EM> varName</EM></A></STRONG><BR>
- <DD>
- The argument following <STRONG>-count</STRONG> gives the name of a variable;
- if a match is found, the number of characters in the matching
- range will be stored in the variable.
- <P></P>
- <DT><STRONG><A NAME="item_%2Dhidden"><STRONG>-hidden</STRONG></A></STRONG><BR>
- <DD>
- Find hidden text as well. By default only displayed text is found.
- <P></P>
- <DT><STRONG><A NAME="item_%2D%2D"><STRONG>--</STRONG></A></STRONG><BR>
- <DD>
- This switch has no effect except to terminate the list of switches:
- the next argument will be treated as <EM>pattern</EM> even if it starts
- with <STRONG>-</STRONG>.
- <P></P></DL>
- </DL>
- <P>The matching range must be entirely within a single line of text.
- For regular expression matching the newlines are removed from the ends
- of the lines before matching: use the <STRONG>$</STRONG> feature in regular
- expressions to match the end of a line.
- For exact matching the newlines are retained.
- If <EM>stopIndex</EM> is specified, the search stops at that index:
- for forward searches, no match at or after <EM>stopIndex</EM> will
- be considered; for backward searches, no match earlier in the
- text than <EM>stopIndex</EM> will be considered.
- If <EM>stopIndex</EM> is omitted, the entire text will be searched:
- when the beginning or end of the text is reached, the search
- continues at the other end until the starting location is reached
- again; if <EM>stopIndex</EM> is specified, no wrap-around will occur.</P>
- <DL>
- <DT><STRONG><A NAME="item_see"><EM>$text</EM>-><STRONG>see</STRONG>(<EM>index</EM>)</A></STRONG><BR>
- <DD>
- Adjusts the view in the window so that the character given by <EM>index</EM>
- is completely visible.
- If <EM>index</EM> is already visible then the command does nothing.
- If <EM>index</EM> is a short distance out of view, the command
- adjusts the view just enough to make <EM>index</EM> visible at the
- edge of the window.
- If <EM>index</EM> is far out of view, then the command centers
- <EM>index</EM> in the window.
- <P></P>
- <DT><STRONG><A NAME="item_tag"><EM>$text</EM>-><STRONG>tag</STRONG>(<EM>option, </EM>?<EM>arg, arg, ...</EM>?)</A></STRONG><BR>
- <DD>
- This command is used to manipulate tags. The exact behavior of the
- command depends on the <EM>option</EM> argument that follows the
- <STRONG>tag</STRONG> argument. The following forms of the command are currently
- supported:
- <DL>
- <DT><STRONG><A NAME="item_tagAdd"><EM>$text</EM>-><STRONG>tagAdd</STRONG>(<EM>tagName, index1, </EM>?<EM>index2, index1, index2, ...</EM>?)</A></STRONG><BR>
- <DD>
- Associate the tag <EM>tagName</EM> with all of the characters starting
- with <EM>index1</EM> and ending just before
- <EM>index2</EM> (the character at <EM>index2</EM> isn't tagged).
- A single command may contain any number of <EM>index1</EM>-<EM>index2</EM>
- pairs.
- If the last <EM>index2</EM> is omitted then the single character at
- <EM>index1</EM> is tagged.
- If there are no characters in the specified range (e.g. <EM>index1</EM>
- is past the end of the file or <EM>index2</EM> is less than or equal
- to <EM>index1</EM>) then the command has no effect.
- <P></P>
- <DT><STRONG><A NAME="item_tagBind"><EM>$text</EM>-><STRONG>tagBind</STRONG>(<EM>tagName, </EM>?<EM>sequence</EM>?, ?<EM>script</EM>?)</A></STRONG><BR>
- <DD>
- This command associates <EM>script</EM> with the tag given by
- <EM>tagName</EM>.
- Whenever the event sequence given by <EM>sequence</EM> occurs for a
- character that has been tagged with <EM>tagName</EM>,
- the script will be invoked.
- This method is similar to the <STRONG>bind</STRONG> command except that
- it operates on characters in a text rather than entire widgets.
- See the <A HREF="../../../site/lib/Tk/bind.html">the Tk::bind manpage</A> documentation for complete details
- on the syntax of <EM>sequence</EM> and the substitutions performed
- on <EM>script</EM> before invoking it.
- If all arguments are specified then a new binding is created, replacing
- any existing binding for the same <EM>sequence</EM> and <EM>tagName</EM>
- (if the first character of <EM>script</EM> is ``+'' then <EM>script</EM>
- augments an existing binding rather than replacing it).
- In this case the return value is an empty string.
- If <EM>script</EM> is omitted then the command returns the <EM>script</EM>
- associated with <EM>tagName</EM> and <EM>sequence</EM> (an error occurs
- if there is no such binding).
- If both <EM>script</EM> and <EM>sequence</EM> are omitted then the command
- returns a list of all the sequences for which bindings have been
- defined for <EM>tagName</EM>.
- <P>The only events for which bindings may be specified are those related
- to the mouse and keyboard (such as <STRONG>Enter</STRONG>, <STRONG>Leave</STRONG>,
- <STRONG>ButtonPress</STRONG>, <STRONG>Motion</STRONG>, and <STRONG>KeyPress</STRONG>) or virtual events.
- Event bindings for a text widget use the <STRONG>current</STRONG> mark described
- under <A HREF="#marks">MARKS</A> above. An <STRONG>Enter</STRONG> event triggers for a tag when the tag
- first becomes present on the current character, and a <STRONG>Leave</STRONG> event
- triggers for a tag when it ceases to be present on the current character.
- <STRONG>Enter</STRONG> and <STRONG>Leave</STRONG> events can happen either because the
- <STRONG>current</STRONG> mark moved or because the character at that position
- changed. Note that these events are different than <STRONG>Enter</STRONG> and
- <STRONG>Leave</STRONG> events for windows. Mouse and keyboard events are directed
- to the current character. If a virtual event is used in a binding, that
- binding can trigger only if the virtual event is defined by an underlying
- mouse-related or keyboard-related event.</P>
- <P>It is possible for the current character to have multiple tags,
- and for each of them to have a binding for a particular event
- sequence.
- When this occurs, one binding is invoked for each tag, in order
- from lowest-priority to highest priority.
- If there are multiple matching bindings for a single tag, then
- the most specific binding is chosen (see the the documentation for
- the <STRONG>bind</STRONG> command for details).
- <STRONG>continue</STRONG> and <STRONG>break</STRONG> commands within binding scripts
- are processed in the same way as for bindings created with
- the <STRONG>bind</STRONG> command.</P>
- <P>If bindings are created for the widget as a whole using the
- <STRONG>bind</STRONG> command, then those bindings will supplement the
- tag bindings.
- The tag bindings will be invoked first, followed by bindings
- for the window as a whole.</P>
- <P></P>
- <DT><STRONG><A NAME="item_tagCget"><EM>$text</EM>-><STRONG>tagCget</STRONG>(<EM>tagName, option</EM>)</A></STRONG><BR>
- <DD>
- This command returns the current value of the option named <EM>option</EM>
- associated with the tag given by <EM>tagName</EM>.
- <EM>Option</EM> may have any of the values accepted by the <STRONG>tag configure</STRONG>
- method.
- <P></P>
- <DT><STRONG><A NAME="item_tagConfigure"><EM>$text</EM>-><STRONG>tagConfigure</STRONG>(<EM>tagName, </EM>?<EM>option</EM>?, ?<EM>value</EM>?, ?<EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- This command is similar to the <STRONG>configure</STRONG> method except
- that it modifies options associated with the tag given by <EM>tagName</EM>
- instead of modifying options for the overall text widget.
- If no <EM>option</EM> is specified, the command returns a list describing
- all of the available options for <EM>tagName</EM>
- (see <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this list).
- If <EM>option</EM> is specified with no <EM>value</EM>, 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 <EM>option</EM>
- is specified).
- If one or more <EM>option-value</EM> pairs are specified, then the command
- modifies the given <CODE>option(s)</CODE> to have the given <CODE>value(s)</CODE> in <EM>tagName</EM>;
- in this case the command returns an empty string.
- See <A HREF="#tags">TAGS</A> above for details on the options available for tags.
- <P></P>
- <DT><STRONG><A NAME="item_tagDelete"><EM>$text</EM>-><STRONG>tagDelete</STRONG>(<EM>tagName, </EM>?<EM>tagName, ...</EM>?)</A></STRONG><BR>
- <DD>
- Deletes all tag information for each of the <EM>tagName</EM>
- arguments.
- The command removes the tags from all characters in the file
- and also deletes any other information associated with the tags,
- such as bindings and display information.
- The command returns an empty string.
- <P></P>
- <DT><STRONG><A NAME="item_tagLower"><EM>$text</EM>-><STRONG>tagLower</STRONG>(<EM>tagName</EM>?, <EM>belowThis</EM>?)</A></STRONG><BR>
- <DD>
- Changes the priority of tag <EM>tagName</EM> so that it is just lower
- in priority than the tag whose name is <EM>belowThis</EM>.
- If <EM>belowThis</EM> is omitted, then <EM>tagName</EM>'s priority
- is changed to make it lowest priority of all tags.
- <P></P>
- <DT><STRONG><A NAME="item_tagNames"><EM>$text</EM>-><STRONG>tagNames</STRONG>(?<EM>index</EM>?)</A></STRONG><BR>
- <DD>
- Returns a list whose elements are the names of all the tags that
- are active at the character position given by <EM>index</EM>.
- If <EM>index</EM> is omitted, then the return value will describe
- all of the tags that exist for the text (this includes all tags
- that have been named in a ``<EM>$text</EM>-><STRONG>tag</STRONG>'' widget
- command but haven't been deleted by a ``<EM>$text</EM>-><STRONG>tagDelete</STRONG>''
- method, even if no characters are currently marked with
- the tag).
- The list will be sorted in order from lowest priority to highest
- priority.
- <P></P>
- <DT><STRONG><A NAME="item_tagNextrange"><EM>$text</EM>-><STRONG>tagNextrange</STRONG>(<EM>tagName, index1, </EM>?<EM>index2</EM>?)</A></STRONG><BR>
- <DD>
- This command searches the text for a range of characters tagged
- with <EM>tagName</EM> where the first character of the range is
- no earlier than the character at <EM>index1</EM> and no later than
- the character just before <EM>index2</EM> (a range starting at
- <EM>index2</EM> will not be considered).
- If several matching ranges exist, the first one is chosen.
- The command's return value is a list containing
- two elements, which are the index of the first character of the
- range and the index of the character just after the last one in
- the range.
- If no matching range is found then the return value is an
- empty string.
- If <EM>index2</EM> is not given then it defaults to the end of the text.
- <P></P>
- <DT><STRONG><A NAME="item_tagPrevrange"><EM>$text</EM>-><STRONG>tagPrevrange</STRONG>(<EM>tagName, index1, </EM>?<EM>index2</EM>?)</A></STRONG><BR>
- <DD>
- This command searches the text for a range of characters tagged
- with <EM>tagName</EM> where the first character of the range is
- before the character at <EM>index1</EM> and no earlier than
- the character at <EM>index2</EM> (a range starting at
- <EM>index2</EM> will be considered).
- If several matching ranges exist, the one closest to <EM>index1</EM> is chosen.
- The command's return value is a list containing
- two elements, which are the index of the first character of the
- range and the index of the character just after the last one in
- the range.
- If no matching range is found then the return value is an
- empty string.
- If <EM>index2</EM> is not given then it defaults to the beginning of the text.
- <P></P>
- <DT><STRONG><A NAME="item_tagRaise"><EM>$text</EM>-><STRONG>tagRaise</STRONG>(<EM>tagName, </EM>?<EM>aboveThis</EM>?)</A></STRONG><BR>
- <DD>
- Changes the priority of tag <EM>tagName</EM> so that it is just higher
- in priority than the tag whose name is <EM>aboveThis</EM>.
- If <EM>aboveThis</EM> is omitted, then <EM>tagName</EM>'s priority
- is changed to make it highest priority of all tags.
- <P></P>
- <DT><STRONG><A NAME="item_tagRanges"><EM>$text</EM>-><STRONG>tagRanges</STRONG>(<EM>tagName</EM>)</A></STRONG><BR>
- <DD>
- Returns a list describing all of the ranges of text that have been
- tagged with <EM>tagName</EM>.
- The first two elements of the list describe the first tagged range
- in the text, the next two elements describe the second range, and
- so on.
- The first element of each pair contains the index of the first
- character of the range, and the second element of the pair contains
- the index of the character just after the last one in the
- range.
- If there are no characters tagged with <EM>tag</EM> then an
- empty string is returned.
- <P></P>
- <DT><STRONG><A NAME="item_tagRemove"><EM>$text</EM>-><STRONG>tagRemove</STRONG>(<EM>tagName, index1, </EM>?<EM>index2, index1, index2, ...</EM>?)</A></STRONG><BR>
- <DD>
- Remove the tag <EM>tagName</EM> from all of the characters starting
- at <EM>index1</EM> and ending just before
- <EM>index2</EM> (the character at <EM>index2</EM> isn't affected).
- A single command may contain any number of <EM>index1</EM>-<EM>index2</EM>
- pairs.
- If the last <EM>index2</EM> is omitted then the single character at
- <EM>index1</EM> is tagged.
- If there are no characters in the specified range (e.g. <EM>index1</EM>
- is past the end of the file or <EM>index2</EM> is less than or equal
- to <EM>index1</EM>) then the command has no effect.
- This command returns an empty string.
- <P></P></DL>
- <DT><STRONG><A NAME="item_widget"><EM>$text</EM>-><STRONG>widget</STRONG>(<EM>option?, arg, arg, ...</EM>?)</A></STRONG><BR>
- <DD>
- <DT><STRONG><A NAME="item_widgetOption"><EM>$text</EM>-><STRONG>widget</STRONG><EM>Option</EM>(?<EM>arg, arg, ...</EM>?)</A></STRONG><BR>
- <DD>
- This method is used to manipulate embedded windows.
- The behavior of the method depends on the <EM>option</EM> argument
- that follows the <STRONG>window</STRONG> argument.
- The following forms of the method are currently supported:
- <DL>
- <DT><STRONG><A NAME="item_windowCget"><EM>$text</EM>-><STRONG>windowCget</STRONG>(<EM>index, option</EM>)</A></STRONG><BR>
- <DD>
- Returns the value of a configuration option for an embedded window.
- <EM>Index</EM> identifies the embedded window, and <EM>option</EM>
- specifies a particular configuration option, which must be one of
- the ones listed in <A HREF="#embedded windows">EMBEDDED WINDOWS</A> above.
- <P></P>
- <DT><STRONG><A NAME="item_windowConfigure"><EM>$text</EM>-><STRONG>windowConfigure</STRONG>(<EM>index</EM>?, <EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- Query or modify the configuration options for an embedded window.
- If no <EM>option</EM> is specified, returns a list describing all of
- the available options for the embedded window at <EM>index</EM>
- (see <A HREF="../../../site/lib/Tk/options.html">the Tk::options manpage</A> for information on the format of this list).
- If <EM>option</EM> is specified with no <EM>value</EM>, 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
- <EM>option</EM> is specified).
- If one or more <EM>option-value</EM> pairs are specified, then the command
- modifies the given <CODE>option(s)</CODE> to have the given value(s); in
- this case the command returns an empty string.
- See <A HREF="#embedded windows">EMBEDDED WINDOWS</A> above for information on the options that
- are supported.
- <P></P>
- <DT><STRONG><A NAME="item_windowCreate"><EM>$text</EM>-><STRONG>windowCreate</STRONG>(<EM>index</EM>?, <EM>option, value, ...</EM>?)</A></STRONG><BR>
- <DD>
- This command creates a new window annotation, which will appear
- in the text at the position given by <EM>index</EM>.
- Any number of <EM>option-value</EM> pairs may be specified to
- configure the annotation.
- See <A HREF="#embedded windows">EMBEDDED WINDOWS</A> above for information on the options that
- are supported.
- Returns an empty string.
- <P></P>
- <DT><STRONG><A NAME="item_windowNames"><EM>$text</EM>-><STRONG>windowNames</STRONG></A></STRONG><BR>
- <DD>
- Returns a list whose elements are the names of all windows currently
- embedded in $text.
- <P></P></DL>
- <DT><STRONG><A NAME="item_xview"><EM>$text</EM>-><STRONG>xview</STRONG>(<EM>option, args</EM>)</A></STRONG><BR>
- <DD>
- This command is used to query and change the horizontal position of the
- text in the widget's window. It can take any of the following
- forms:
- <DL>
- <DT><STRONG><EM>$text</EM>-><STRONG>xview</STRONG></STRONG><BR>
- <DD>
- Returns a list containing two elements.
- Each element is a real fraction between 0 and 1; together they describe
- the portion of the document's horizontal span that is visible in
- the window.
- For example, if the first element is .2 and the second element is .6,
- 20% of the text is off-screen to the left, the middle 40% is visible
- in the window, and 40% of the text is off-screen to the right.
- The fractions refer only to the lines that are actually visible in the
- window: if the lines in the window are all very short, so that they
- are entirely visible, the returned fractions will be 0 and 1,
- even if there are other lines in the text that are
- much wider than the window.
- These are the same values passed to scrollbars via the <STRONG>-xscrollcommand</STRONG>
- option.
- <P></P>
- <DT><STRONG><A NAME="item_xviewMoveto"><EM>$text</EM>-><STRONG>xviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
- <DD>
- Adjusts the view in the window so that <EM>fraction</EM> of the horizontal
- span of the text is off-screen to the left.
- <EM>Fraction</EM> is a fraction between 0 and 1.
- <P></P>
- <DT><STRONG><A NAME="item_xviewScroll"><EM>$text</EM>-><STRONG>xviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
- <DD>
- This command shifts the view in the window left or right according to
- <EM>number</EM> and <EM>what</EM>.
- <EM>Number</EM> must be an integer.
- <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG> or an abbreviation
- of one of these.
- If <EM>what</EM> is <STRONG>units</STRONG>, the view adjusts left or right by
- <EM>number</EM> average-width characters on the display; if it is
- <STRONG>pages</STRONG> then the view adjusts by <EM>number</EM> screenfuls.
- If <EM>number</EM> is negative then characters farther to the left
- become visible; if it is positive then characters farther to the right
- become visible.
- <P></P></DL>
- <DT><STRONG><A NAME="item_yview"><EM>$text</EM>-><STRONG>yview</STRONG>(<EM>?args</EM>?)</A></STRONG><BR>
- <DD>
- This command is used to query and change the vertical position of the
- text in the widget's window.
- It can take any of the following forms:
- <DL>
- <DT><STRONG><EM>$text</EM>-><STRONG>yview</STRONG></STRONG><BR>
- <DD>
- Returns a list containing two elements, both of which are real fractions
- between 0 and 1.
- The first element gives the position of the first character in the
- top line in the window, relative to the text as a whole (0.5 means
- it is halfway through the text, for example).
- The second element gives the position of the character just after
- the last one in the bottom line of the window,
- relative to the text as a whole.
- These are the same values passed to scrollbars via the <STRONG>-yscrollcommand</STRONG>
- option.
- <P></P>
- <DT><STRONG><A NAME="item_yviewMoveto"><EM>$text</EM>-><STRONG>yviewMoveto</STRONG>(<EM>fraction</EM>)</A></STRONG><BR>
- <DD>
- Adjusts the view in the window so that the character given by <EM>fraction</EM>
- appears on the top line of the window.
- <EM>Fraction</EM> is a fraction between 0 and 1; 0 indicates the first
- character in the text, 0.33 indicates the character one-third the
- way through the text, and so on.
- <P></P>
- <DT><STRONG><A NAME="item_yviewScroll"><EM>$text</EM>-><STRONG>yviewScroll</STRONG>(<EM>number, what</EM>)</A></STRONG><BR>
- <DD>
- This command adjust the view in the window up or down according to
- <EM>number</EM> and <EM>what</EM>.
- <EM>Number</EM> must be an integer.
- <EM>What</EM> must be either <STRONG>units</STRONG> or <STRONG>pages</STRONG>.
- If <EM>what</EM> is <STRONG>units</STRONG>, the view adjusts up or down by
- <EM>number</EM> lines on the display; if it is <STRONG>pages</STRONG> then
- the view adjusts by <EM>number</EM> screenfuls.
- If <EM>number</EM> is negative then earlier positions in the text
- become visible; if it is positive then later positions in the text
- become visible.
- <P></P>
- <DT><STRONG><EM>$text</EM>-><STRONG>yview</STRONG>(?<STRONG>-pickplace</STRONG>,? <EM>index</EM>)</STRONG><BR>
- <DD>
- Changes the view in the <EM>$text</EM>'s window to make <EM>index</EM> visible.
- If the <STRONG>-pickplace</STRONG> option isn't specified then <EM>index</EM> will
- appear at the top of the window.
- If <STRONG>-pickplace</STRONG> is specified then the widget chooses where
- <EM>index</EM> appears in the window:
- <DL>
- <DT><STRONG>[1]</STRONG><BR>
- <DD>
- If <EM>index</EM> is already visible somewhere in the window then the
- command does nothing.
- <P></P>
- <DT><STRONG>[2]</STRONG><BR>
- <DD>
- If <EM>index</EM> is only a few lines off-screen above the window then
- it will be positioned at the top of the window.
- <P></P>
- <DT><STRONG>[3]</STRONG><BR>
- <DD>
- If <EM>index</EM> is only a few lines off-screen below the window then
- it will be positioned at the bottom of the window.
- <P></P>
- <DT><STRONG><A NAME="item_%5B4%5D">[4]</A></STRONG><BR>
- <DD>
- Otherwise, <EM>index</EM> will be centered in the window.
- <P></P></DL>
- </DL>
- </DL>
- <P>The <STRONG>-pickplace</STRONG> option has been obsoleted by the <STRONG>see</STRONG> widget
- command (<STRONG>see</STRONG> handles both x- and y-motion to make a location
- visible, whereas <STRONG>-pickplace</STRONG> only handles motion in y).</P>
- <DL>
- <DT><STRONG><EM>$text</EM>-><STRONG>yview</STRONG>(<EM>number</EM>)</STRONG><BR>
- <DD>
- This command makes the first character on the line after
- the one given by <EM>number</EM> visible at the top of the window.
- <EM>Number</EM> must be an integer.
- This command used to be used for scrolling, but now it is obsolete.
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="bindings">BINDINGS</A></H1>
- <P>Tk automatically creates class bindings for texts that give them
- the following default behavior.
- In the descriptions below, ``word'' refers to a contiguous group
- of letters, digits, or ``_'' characters, or any single character
- other than these.</P>
- <DL>
- <DT><STRONG>[1]</STRONG><BR>
- <DD>
- Clicking mouse button 1 positions the insertion cursor
- just before the character underneath the mouse cursor, sets the
- input focus to this widget, and clears any selection in the widget.
- Dragging with mouse button 1 strokes out a selection between
- the insertion cursor and the character under the mouse.
- <P></P>
- <DT><STRONG>[2]</STRONG><BR>
- <DD>
- Double-clicking with mouse button 1 selects the word under the mouse
- and positions the insertion cursor at the beginning of the word.
- Dragging after a double click will stroke out a selection consisting
- of whole words.
- <P></P>
- <DT><STRONG>[3]</STRONG><BR>
- <DD>
- Triple-clicking with mouse button 1 selects the line under the mouse
- and positions the insertion cursor at the beginning of the line.
- Dragging after a triple click will stroke out a selection consisting
- of whole lines.
- <P></P>
- <DT><STRONG>[4]</STRONG><BR>
- <DD>
- The ends of the selection can be adjusted by dragging with mouse
- button 1 while the Shift key is down; this will adjust the end
- of the selection that was nearest to the mouse cursor when button
- 1 was pressed.
- If the button is double-clicked before dragging then the selection
- will be adjusted in units of whole words; if it is triple-clicked
- then the selection will be adjusted in units of whole lines.
- <P></P>
- <DT><STRONG><A NAME="item_%5B5%5D">[5]</A></STRONG><BR>
- <DD>
- Clicking mouse button 1 with the Control key down will reposition the
- insertion cursor without affecting the selection.
- <P></P>
- <DT><STRONG><A NAME="item_%5B6%5D">[6]</A></STRONG><BR>
- <DD>
- If any normal printing characters are typed, they are
- inserted at the point of the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B7%5D">[7]</A></STRONG><BR>
- <DD>
- The view in the widget can be adjusted by dragging with mouse button 2.
- If mouse button 2 is clicked without moving the mouse, the selection
- is copied into the text at the position of the mouse cursor.
- The Insert key also inserts the selection, but at the position of
- the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B8%5D">[8]</A></STRONG><BR>
- <DD>
- If the mouse is dragged out of the widget
- while button 1 is pressed, the entry will automatically scroll to
- make more text visible (if there is more text off-screen on the side
- where the mouse left the window).
- <P></P>
- <DT><STRONG><A NAME="item_%5B9%5D">[9]</A></STRONG><BR>
- <DD>
- The Left and Right keys move the insertion cursor one character to the
- left or right; they also clear any selection in the text.
- If Left or Right is typed with the Shift key down, then the insertion
- cursor moves and the selection is extended to include the new character.
- Control-Left and Control-Right move the insertion cursor by words, and
- Control-Shift-Left and Control-Shift-Right move the insertion cursor
- by words and also extend the selection.
- Control-b and Control-f behave the same as Left and Right, respectively.
- Meta-b and Meta-f behave the same as Control-Left and Control-Right,
- respectively.
- <P></P>
- <DT><STRONG><A NAME="item_%5B10%5D">[10]</A></STRONG><BR>
- <DD>
- The Up and Down keys move the insertion cursor one line up or
- down and clear any selection in the text.
- If Up or Right is typed with the Shift key down, then the insertion
- cursor moves and the selection is extended to include the new character.
- Control-Up and Control-Down move the insertion cursor by paragraphs (groups
- of lines separated by blank lines), and
- Control-Shift-Up and Control-Shift-Down move the insertion cursor
- by paragraphs and also extend the selection.
- Control-p and Control-n behave the same as Up and Down, respectively.
- <P></P>
- <DT><STRONG><A NAME="item_%5B11%5D">[11]</A></STRONG><BR>
- <DD>
- The Next and Prior keys move the insertion cursor forward or backwards
- by one screenful and clear any selection in the text.
- If the Shift key is held down while Next or Prior is typed, then
- the selection is extended to include the new character.
- Control-v moves the view down one screenful without moving the
- insertion cursor or adjusting the selection.
- <P></P>
- <DT><STRONG><A NAME="item_%5B12%5D">[12]</A></STRONG><BR>
- <DD>
- Control-Next and Control-Prior scroll the view right or left by one page
- without moving the insertion cursor or affecting the selection.
- <P></P>
- <DT><STRONG><A NAME="item_%5B13%5D">[13]</A></STRONG><BR>
- <DD>
- Home and Control-a move the insertion cursor to the
- beginning of its line and clear any selection in the widget.
- Shift-Home moves the insertion cursor to the beginning of the line
- and also extends the selection to that point.
- <P></P>
- <DT><STRONG><A NAME="item_%5B14%5D">[14]</A></STRONG><BR>
- <DD>
- End and Control-e move the insertion cursor to the
- end of the line and clear any selection in the widget.
- Shift-End moves the cursor to the end of the line and extends the selection
- to that point.
- <P></P>
- <DT><STRONG><A NAME="item_%5B15%5D">[15]</A></STRONG><BR>
- <DD>
- Control-Home and Meta-< move the insertion cursor to the beginning of
- the text and clear any selection in the widget.
- Control-Shift-Home moves the insertion cursor to the beginning of the text
- and also extends the selection to that point.
- <P></P>
- <DT><STRONG><A NAME="item_%5B16%5D">[16]</A></STRONG><BR>
- <DD>
- Control-End and Meta-> move the insertion cursor to the end of the
- text and clear any selection in the widget.
- Control-Shift-End moves the cursor to the end of the text and extends
- the selection to that point.
- <P></P>
- <DT><STRONG><A NAME="item_%5B17%5D">[17]</A></STRONG><BR>
- <DD>
- The Select key and Control-Space set the selection anchor to the position
- of the insertion cursor. They don't affect the current selection.
- Shift-Select and Control-Shift-Space adjust the selection to the
- current position of the insertion cursor, selecting from the anchor
- to the insertion cursor if there was not any selection previously.
- <P></P>
- <DT><STRONG><A NAME="item_%5B18%5D">[18]</A></STRONG><BR>
- <DD>
- Control-/ selects the entire contents of the widget.
- <P></P>
- <DT><STRONG><A NAME="item_%5B19%5D">[19]</A></STRONG><BR>
- <DD>
- Control-\ clears any selection in the widget.
- <P></P>
- <DT><STRONG><A NAME="item_%5B20%5D">[20]</A></STRONG><BR>
- <DD>
- The F16 key (labelled Copy on many Sun workstations) or Meta-w
- copies the selection in the widget to the clipboard, if there is a selection.
- <P></P>
- <DT><STRONG><A NAME="item_%5B21%5D">[21]</A></STRONG><BR>
- <DD>
- The F20 key (labelled Cut on many Sun workstations) or Control-w
- copies the selection in the widget to the clipboard and deletes
- the selection.
- If there is no selection in the widget then these keys have no effect.
- <P></P>
- <DT><STRONG><A NAME="item_%5B22%5D">[22]</A></STRONG><BR>
- <DD>
- The F18 key (labelled Paste on many Sun workstations) or Control-y
- inserts the contents of the clipboard at the position of the
- insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B23%5D">[23]</A></STRONG><BR>
- <DD>
- The Delete key deletes the selection, if there is one in the widget.
- If there is no selection, it deletes the character to the right of
- the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B24%5D">[24]</A></STRONG><BR>
- <DD>
- Backspace and Control-h delete the selection, if there is one
- in the widget.
- If there is no selection, they delete the character to the left of
- the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B25%5D">[25]</A></STRONG><BR>
- <DD>
- Control-d deletes the character to the right of the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B26%5D">[26]</A></STRONG><BR>
- <DD>
- Meta-d deletes the word to the right of the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B27%5D">[27]</A></STRONG><BR>
- <DD>
- Control-k deletes from the insertion cursor to the end of its line;
- if the insertion cursor is already at the end of a line, then
- Control-k deletes the newline character.
- <P></P>
- <DT><STRONG><A NAME="item_%5B28%5D">[28]</A></STRONG><BR>
- <DD>
- Control-o opens a new line by inserting a newline character in
- front of the insertion cursor without moving the insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B29%5D">[29]</A></STRONG><BR>
- <DD>
- Meta-backspace and Meta-Delete delete the word to the left of the
- insertion cursor.
- <P></P>
- <DT><STRONG><A NAME="item_%5B30%5D">[30]</A></STRONG><BR>
- <DD>
- Control-x deletes whatever is selected in the text widget.
- <P></P>
- <DT><STRONG><A NAME="item_%5B31%5D">[31]</A></STRONG><BR>
- <DD>
- Control-t reverses the order of the two characters to the right of
- the insertion cursor.
- <P>If the widget is disabled using the <STRONG>-state</STRONG> option, then its
- view can still be adjusted and text can still be selected,
- but no insertion cursor will be displayed and no text modifications will
- take place.</P>
- <P>The behavior of texts can be changed by defining new bindings for
- individual widgets or by redefining the class bindings.</P>
- <P></P></DL>
- <P>
- <HR>
- <H1><A NAME="performance issues">PERFORMANCE ISSUES</A></H1>
- <P>Text widgets should run efficiently under a variety
- of conditions. The text widget uses about 2-3 bytes of
- main memory for each byte of text, so texts containing a megabyte
- or more should be practical on most workstations.
- Text is represented internally with a modified B-tree structure
- that makes operations relatively efficient even with large texts.
- Tags are included in the B-tree structure in a way that allows
- tags to span large ranges or have many disjoint smaller ranges
- without loss of efficiency.
- Marks are also implemented in a way that allows large numbers of
- marks.
- In most cases it is fine to have large numbers of unique tags,
- or a tag that has many distinct ranges.</P>
- <P>One performance problem can arise if you have hundreds or thousands
- of different tags that all have the following characteristics:
- the first and last ranges of each tag are near the beginning and
- end of the text, respectively,
- or a single tag range covers most of the text widget.
- The cost of adding and deleting tags like this is proportional
- to the number of other tags with the same properties.
- In contrast, there is no problem with having thousands of distinct
- tags if their overall ranges are localized and spread uniformly throughout
- the text.</P>
- <P>Very long text lines can be expensive,
- especially if they have many marks and tags within them.</P>
- <P>The display line with the insert cursor is redrawn each time the
- cursor blinks, which causes a steady stream of graphics traffic.
- Set the <STRONG>-insertofftime</STRONG> option to 0 avoid this.</P>
- <P>
- <HR>
- <H1><A NAME="see also">SEE ALSO</A></H1>
- <P><A HREF="../../../site/lib/Tk/ROText.html">Tk::ROText</A>
- <A HREF="../../../site/lib/Tk/TextUndo.html">Tk::TextUndo</A></P>
- <P>
- <HR>
- <H1><A NAME="keywords">KEYWORDS</A></H1>
- <P>text, widget</P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Tk::Text - Create and manipulate Text widgets</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-