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

📄 text.n

📁 linux系统下的音频通信
💻 N
📖 第 1 页 / 共 5 页
字号:
By default, characters are displayed as determined by the\fBbackground\fR, \fBfont\fR, and \fBforeground\fR options for thetext widget.However, display options may be associated with individual tagsusing the ``\fIpathName \fBtag configure\fR'' widget command.If a character has been tagged, then the display options associatedwith the tag override the default display style.The following options are currently supported for tags:.TP\fB\-background \fIcolor\fR\fIColor\fR specifies the background color to use for charactersassociated with the tag.It may have any of the forms accepted by \fBTk_GetColor\fR..TP\fB\-bgstipple \fIbitmap\fR\fIBitmap\fR specifies a bitmap that is used as a stipple patternfor the background.It may have any of the forms accepted by \fBTk_GetBitmap\fR.If \fIbitmap\fR hasn't been specified, or if it is specifiedas an empty string, then a solid fill will be used for thebackground..TP\fB\-borderwidth \fIpixels\fR\fIPixels\fR specifies the width of a 3-D border to draw aroundthe background.It may have any of the forms accepted by \fBTk_GetPixels\fR.This option is used in conjunction with the \fB\-relief\fRoption to give a 3-D appearance to the background for characters;it is ignored unless the \fB\-background\fR optionhas been set for the tag..TP\fB\-fgstipple \fIbitmap\fR\fIBitmap\fR specifies a bitmap that is used as a stipple patternwhen drawing text and other foreground information such asunderlines.It may have any of the forms accepted by \fBTk_GetBitmap\fR.If \fIbitmap\fR hasn't been specified, or if it is specifiedas an empty string, then a solid fill will be used..TP\fB\-font \fIfontName\fR\fIFontName\fR is the name of a font to use for drawing characters.It may have any of the forms accepted by \fBTk_GetFontStruct\fR..TP\fB\-foreground \fIcolor\fR\fIColor\fR specifies the color to use when drawing text and otherforeground information such as underlines.It may have any of the forms accepted by \fBTk_GetColor\fR..TP\fB\-justify \fIjustify\fRIf the first character of a display line has a tag for which thisoption has been specified, then \fIjustify\fR determines how tojustify the line.It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR.If a line wraps, then the justification for each line on thedisplay is determined by the first character of that display line..TP\fB\-lmargin1 \fIpixels\fRIf the first character of a text line has a tag for which thisoption has been specified, then \fIpixels\fR specifies howmuch the line should be indented from the left edge of thewindow.\fIPixels\fR may have any of the standard forms for screendistances.If a line of text wraps, this option only applies to thefirst line on the display;  the \fB\-lmargin2\fR option controlsthe indentation for subsequent lines..TP\fB\-lmargin2 \fIpixels\fRIf the first character of a display line has a tag for which thisoption has been specified, and if the display line is not thefirst for its text line (i.e., the text line has wrapped), then\fIpixels\fR specifies how much the line should be indented fromthe left edge of the window.\fIPixels\fR may have any of the standard forms for screendistances.This option is only used when wrapping is enabled, and it onlyapplies to the second and later display lines for a text line..TP\fB\-offset \fIpixels\fR\fIPixels\fR specifies an amount by which the text's baselineshould be offset vertically from the baseline of the overallline, in pixels.For example, a positive offset can be used for superscriptsand a negative offset can be used for subscripts.\fIPixels\fR may have any of the standard forms for screendistances..TP\fB\-overstrike \fIboolean\fRSpecifies whether or not to draw a horizontal rule throughthe middle of characters.\fIBoolean\fR may have any of the forms accepted by \fBTk_GetBoolean\fR..TP\fB\-relief \fIrelief\fR\fIRelief\fR specifies the 3-D relief to use for drawing backgrounds,in any of the forms accepted by \fBTk_GetRelief\fR.This option is used in conjunction with the \fB\-borderwidth\fRoption to give a 3-D appearance to the background for characters;it is ignored unless the \fB\-background\fR optionhas been set for the tag..TP\fB\-rmargin \fIpixels\fRIf the first character of a display line has a tag for which thisoption has been specified, then \fIpixels\fR specifies how widea margin to leave between the end of the line and the rightedge of the window.\fIPixels\fR may have any of the standard forms for screendistances.This option is only used when wrapping is enabled.If a text line wraps, the right margin for each line on thedisplay is determined by the first character of that displayline..TP\fB\-spacing1 \fIpixels\fR\fIPixels\fR specifies how much additional space should beleft above each text line, using any of the standard forms forscreen distances.If a line wraps, this option only applies to the firstline on the display..TP\fB\-spacing2 \fIpixels\fRFor lines that wrap, this option specifies how much additionalspace to leave between the display lines for a single text line.\fIPixels\fR may have any of the standard forms for screendistances..TP\fB\-spacing3 \fIpixels\fR\fIPixels\fR specifies how much additional space should beleft below each text line, using any of the standard forms forscreen distances.If a line wraps, this option only applies to the lastline on the display..TP\fB\-tabs \fItabList\fR\fITabList\fR specifies a set of tab stops in the same formas for the \fB\-tabs\fR option for the text widget.  Thisoption only applies to a display line if it applies to thefirst character on that display line.If this option is specified as an empty string, it cancelsthe option, leaving it unspecified for the tag (the default).If the option is specified as a non-empty string that isan empty list, such as \fB\-tags\0{\0}\fR, then it requestsdefault 8-character tabs as described for the \fBtags\fRwidget option..TP\fB\-underline \fIboolean\fR\fIBoolean\fR specifies whether or not to draw an underline underneathcharacters.It may have any of the forms accepted by \fBTk_GetBoolean\fR..TP\fB\-wrap \fImode\fR\fIMode\fR specifies how to handle lines that are wider than thetext's window.It has the same legal values as the \fB\-wrap\fR optionfor the text widget:  \fBnone\fR, \fBchar\fR, or \fBword\fR.If this tag option is specified, it overrides the \fB\-wrap\fR optionfor the text widget..PPIf a character has several tags associated with it, and if theirdisplay options conflict, then the options of the highest prioritytag are used.If a particular display option hasn't been specified for aparticular tag, or if it is specified as an empty string, thenthat option will never be used;  the next-highest-prioritytag's option will used instead.If no tag specifies a particular display option, then the defaultstyle for the widget will be used..PPThe second purpose for tags is event bindings.You can associate bindings with a tag in much the same way you canassociate bindings with a widget class:  whenever particular Xevents occur on characters with the given tag, a givenTcl command will be executed.Tag bindings can be used to give behaviors to ranges of characters;among other things, this allows hypertext-likefeatures to be implemented.For details, see the description of the \fBtag bind\fR widgetcommand below..PPThe third use for tags is in managing the selection.See THE SELECTION below..SH MARKS.PPThe 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 andthey refer to places in the file, but a mark isn't associatedwith 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 giventime.If the characters around a mark are deleted the mark will stillremain;  it will just have new neighbor characters.In contrast, if the characters containing a tag are deleted thenthe tag will no longer have an association with characters inthe file.Marks may be manipulated with the ``\fIpathName \fBmark\fR'' widgetcommand, and their current locations may be determined by using themark name as an index in widget commands..PPEach mark also has a \fIgravity\fR, which is either \fBleft\fR or\fBright\fR.The gravity for a mark specifies what happens to the mark whentext is inserted at the point of the mark.If a mark has left gravity, then the mark is treated as if itwere attached to the character on its left, so the mark willremain to the left of any text inserted at the mark position.If the mark has right gravity, new text inserted at the markposition will appear to the right of the mark.  The gravityfor a mark defaults to \fBright\fR..PPThe name space for marks is different from that for tags:  thesame name may be used for both a mark and a tag, but they will referto different things..PPTwo marks have special significance.First, the mark \fBinsert\fR is associated with the insertion cursor,as described under THE INSERTION CURSOR below.Second, the mark \fBcurrent\fR is associated with the characterclosest to the mouse and is adjusted automatically to track themouse position and any changes to the text in the widget (oneexception:  \fBcurrent\fR is not updated in response to mousemotions if a mouse button is down;  the update will be deferreduntil all mouse buttons have been released).Neither of these special marks may be deleted..SH EMBEDDED WINDOWS.PPThe third form of annotation in text widgets is an embedded window.Each embedded window annotation causes a window to be displayedat 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 theusual rules for geometry management, which require the text windowto be the parent of the embedded window or a descendant of itsparent).The embedded window's position on the screen will be updated as thetext is modified or scrolled, and it will be mapped and unmapped asit moves into and out of the visible area of the text widget.Each embedded window occupies one character's worth of index spacein the text widget, and it may be referred to either by the nameof its embedded window or by its position in the widget'sindex space.If the range of text containing the embedded window is deleted thenthe window is destroyed..PPWhen an embedded window is added to a text widget with the\fBwindow create\fR widget command, several configurationoptions may be associated with it.These options may be  modified later with the \fBwindow configure\fRwidget command.The following options are currently supported:.TP\fB\-align \fIwhere\fRIf 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.\fIWhere\fR must have one of the values \fBtop\fR (align the top of the windowwith the top of the line), \fBcenter\fR (center the windowwithin the range of the line), \fBbottom\fR (align the bottom of thewindow with the bottom of the line's area),or \fBbaseline\fR (align the bottom of the window with the baselineof the line)..TP\fB\-create \fIscript\fRSpecifies a Tcl script that may be evaluated to create the windowfor the annotation.If no \fB\-window\fR option has been specified for the annotationthis script will be evaluated when the annotation is about tobe displayed on the screen.\fIScript\fR must create a window for the annotation and returnthe name of that window as its result.If the annotation's window should ever be deleted, \fIscript\fRwill be evaluated again the next time the annotation is displayed..TP\fB\-padx \fIpixels\fR\fIPixels\fR specifies the amount of extra space to leave oneach side of the embedded window.It may have any of the usual forms defined for a screen distance..TP\fB\-pady \fIpixels\fR\fIPixels\fR specifies the amount of extra space to leave onthe top and on the bottom of the embedded window.It may have any of the usual forms defined for a screen distance..TP\fB\-stretch \fIboolean\fRIf the requested height of the embedded window is less than theheight of the line in which it is displayed, this option can beused to specify whether the window should be stretched verticallyto fill its line.If the \fB\-pady\fR option has been specified as well, then therequested padding will be retained even if the window isstretched..TP\fB\-window \fIpathName\fRSpecifies the name of a window to display in the annotation.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -