?? canvas.n
字號(hào):
adjusts in units of nine-tenths the window's width.If \fInumber\fR is negative then information farther to the leftbecomes visible; if it is positive then information farther to the rightbecomes visible..RE.TP\fIpathName \fByview \fI?args\fR?This command is used to query and change the vertical position of theinformation displayed in the canvas's window.It can take any of the following forms:.RS.TP\fIpathName \fByview\fRReturns a list containing two elements.Each element is a real fraction between 0 and 1; together they describethe vertical span that is visible in the window.For example, if the first element is .6 and the second element is 1.0,the lowest 40% of the canvas's area (as defined by the \fB\-scrollregion\fRoption) is visible in the window.These are the same values passed to scrollbars via the \fB\-yscrollcommand\fRoption..TP\fIpathName \fByview moveto\fI fraction\fRAdjusts the view in the window so that \fIfraction\fR of the canvas'sarea is off-screen to the top.\fIFraction\fR is a fraction between 0 and 1..TP\fIpathName \fByview scroll \fInumber what\fRThis command adjusts the view in the window up or down according to\fInumber\fR and \fIwhat\fR.\fINumber\fR must be an integer.\fIWhat\fR must be either \fBunits\fR or \fBpages\fR.If \fIwhat\fR is \fBunits\fR, the view adjusts up or down in unitsof the \fByScrollIncrement\fR option, if it is greater than zero,or in units of one-tenth the window's height otherwise.If \fIwhat\fR is \fBpages\fR thenthe view adjusts in units of nine-tenths the window's height.If \fInumber\fR is negative then higher information becomesvisible; if it is positive then lower informationbecomes visible..RE.SH "OVERVIEW OF ITEM TYPES".PPThe sections below describe the various types of items supportedby canvas widgets. Each item type is characterized by two things:first, the form of the \fBcreate\fR command used to createinstances of the type; and second, a set of configuration optionsfor items of that type, which may be used in the\fBcreate\fR and \fBitemconfigure\fR widget commands.Most items don't support indexing or selection or the commandsrelated to them, such as \fBindex\fR and \fBinsert\fR.Where items do support these facilities, it is noted explicitlyin the descriptions below (at present, only text items providethis support)..SH "ARC ITEMS".PPItems of type \fBarc\fR appear on the display as arc-shaped regions.An arc is a section of an oval delimited by two angles (specifiedby the \fB\-start\fR and \fB\-extent\fR options) and displayed inone of several ways (specified by the \fB\-style\fR option).Arcs are created with widget commands of the following form:.CS\fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?.CEThe arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR givethe coordinates of two diagonally opposite corners of arectangular region enclosing the oval that defines the arc.After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fRpairs, each of which sets one of the configuration optionsfor the item. These same \fIoption\fR\-\fIvalue\fR pairs may beused in \fBitemconfigure\fR widget commands to change the item'sconfiguration.The following options are supported for arcs:.TP\fB\-extent \fIdegrees\fRSpecifies the size of the angular range occupied by the arc.The arc's range extends for \fIdegrees\fR degrees counter-clockwisefrom the starting angle given by the \fB\-start\fR option.\fIDegrees\fR may be negative.If it is greater than 360 or less than -360, then \fIdegrees\fRmodulo 360 is used as the extent..TP\fB\-fill \fIcolor\fRFill the region of the arc with \fIcolor\fR.\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.If \fIcolor\fR is an empty string (the default), thenthen the arc will not be filled..TP\fB\-outline \fIcolor\fR\fIColor\fR specifies a color to use for drawing the arc'soutline; it may have any of the forms accepted by \fBTk_GetColor\fR.This option defaults to \fBblack\fR. If \fIcolor\fR is specifiedas an empty string then no outline is drawn for the arc..TP\fB\-outlinestipple \fIbitmap\fRIndicates that the outline for the arc should be drawn with a stipple pattern;\fIbitmap\fR specifies the stipple pattern to use, in any of theforms accepted by \fBTk_GetBitmap\fR.If the \fB\-outline\fR option hasn't been specified then this optionhas no effect.If \fIbitmap\fR is an empty string (the default), then the outline is drawnin a solid fashion..TP\fB\-start \fIdegrees\fRSpecifies the beginning of the angular range occupied by thearc.\fIDegrees\fR is given in units of degrees measured counter-clockwisefrom the 3-o'clock position; it may be either positive or negative..TP\fB\-stipple \fIbitmap\fRIndicates that the arc should be filled in a stipple pattern;\fIbitmap\fR specifies the stipple pattern to use, in any of theforms accepted by \fBTk_GetBitmap\fR.If the \fB\-fill\fR option hasn't been specified then this optionhas no effect.If \fIbitmap\fR is an empty string (the default), then filling is donein a solid fashion..TP\fB\-style \fItype\fRSpecifies how to draw the arc. If \fItype\fR is \fBpieslice\fR(the default) then the arc's region is defined by a sectionof the oval's perimeter plus two line segments, one between the centerof the oval and each end of the perimeter section.If \fItype\fR is \fBchord\fR then the arc's region is definedby a section of the oval's perimeter plus a single line segmentconnecting the two end points of the perimeter section.If \fItype\fR is \fBarc\fR then the arc's region consists ofa section of the perimeter alone.In this last case the \fB\-fill\fR option is ignored..TP\fB\-tags \fItagList\fRSpecifies a set of tags to apply to the item.\fITagList\fR consists of a list of tag names, which replace anyexisting tags for the item.\fITagList\fR may be an empty list..TP\fB\-width \fIoutlineWidth\fRSpecifies the width of the outline to be drawn aroundthe arc's region, in any of the forms described in the COORDINATESsection above.If the \fB\-outline\fR option has been specified as an empty stringthen this option has no effect.Wide outlines will be drawn centered on the edges of the arc's region.This option defaults to 1.0..SH "BITMAP ITEMS".PPItems of type \fBbitmap\fR appear on the display as images withtwo colors, foreground and background.Bitmaps are created with widget commands of the following form:.CS\fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value option value ...\fR?.CEThe arguments \fIx\fR and \fIy\fR specify the coordinates of apoint used to position the bitmap on the display (see the \fB\-anchor\fRoption below for more information on how bitmaps are displayed).After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fRpairs, each of which sets one of the configuration optionsfor the item. These same \fIoption\fR\-\fIvalue\fR pairs may beused in \fBitemconfigure\fR widget commands to change the item'sconfiguration.The following options are supported for bitmaps:.TP\fB\-anchor \fIanchorPos\fR\fIAnchorPos\fR tells how to position the bitmap relative to thepositioning point for the item; it may have any of the formsaccepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fRis \fBcenter\fR then the bitmap is centered on the point; if\fIanchorPos\fR is \fBn\fR then the bitmap will be drawn so thatits top center point is at the positioning point.This option defaults to \fBcenter\fR..TP\fB\-background \fIcolor\fRSpecifies a color to use for each of the bitmap pixelswhose value is 0.\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.If this option isn't specified, or if it is specified as an emptystring, then nothing is displayed where the bitmap pixels are 0; thisproduces a transparent effect..TP\fB\-bitmap \fIbitmap\fRSpecifies the bitmap to display in the item.\fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR..TP\fB\-foreground \fIcolor\fRSpecifies a color to use for each of the bitmap pixelswhose value is 1.\fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR anddefaults to \fBblack\fR..TP\fB\-tags \fItagList\fRSpecifies a set of tags to apply to the item.\fITagList\fR consists of a list of tag names, which replace anyexisting tags for the item.\fITagList\fR may be an empty list..SH "IMAGE ITEMS".PPItems of type \fBimage\fR are used to display images on acanvas.Images are created with widget commands of the following form:.CS\fIpathName \fBcreate image \fIx y \fR?\fIoption value option value ...\fR?.CEThe arguments \fIx\fR and \fIy\fR specify the coordinates of apoint used to position the image on the display (see the \fB\-anchor\fRoption below for more information).After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fRpairs, each of which sets one of the configuration optionsfor the item. These same \fIoption\fR\-\fIvalue\fR pairs may beused in \fBitemconfigure\fR widget commands to change the item'sconfiguration.The following options are supported for images:.TP\fB\-anchor \fIanchorPos\fR\fIAnchorPos\fR tells how to position the image relative to thepositioning point for the item; it may have any of the formsaccepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fRis \fBcenter\fR then the image is centered on the point; if\fIanchorPos\fR is \fBn\fR then the image will be drawn so thatits top center point is at the positioning point.This option defaults to \fBcenter\fR..TP\fB\-image \fIname\fRSpecifies the name of the image to display in the item.This image must have been created previously with the\fBimage create\fR command..TP\fB\-tags \fItagList\fRSpecifies a set of tags to apply to the item.\fITagList\fR consists of a list of tag names, which replace anyexisting tags for the item; it may be an empty list..SH "LINE ITEMS".PPItems of type \fBline\fR appear on the display as one or more connectedline segments or curves.Lines are created with widget commands of the following form:.CS\fIpathName \fBcreate line \fIx1 y1... xn yn \fR?\fIoption value option value ...\fR?.CEThe arguments \fIx1\fR through \fIyn\fR givethe coordinates for a series of two or more points that describea series of connected line segments.After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fRpairs, each of which sets one of the configuration optionsfor the item. These same \fIoption\fR\-\fIvalue\fR pairs may beused in \fBitemconfigure\fR widget commands to change the item'sconfiguration.The following options are supported for lines:.TP\fB\-arrow \fIwhere\fRIndicates whether or not arrowheads are to be drawn at one or bothends of the line.\fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads),\fBfirst\fR (for an arrowhead at the first point of the line),\fBlast\fR (for an arrowhead at the last point of the line), or\fBboth\fR (for arrowheads at both ends).This option defaults to \fBnone\fR..TP\fB\-arrowshape \fIshape\fRThis option indicates how to draw arrowheads.The \fIshape\fR argument must be a list with three elements, eachspecifying a distance in any of the forms described inthe COORDINATES section above.The first element of the list gives the distance along the linefrom the neck of the arrowhead to its tip.The second element gives the distance along the line from thetrailing points of the arrowhead to the tip, and the thirdelement gives the distance from the outside edge of the line to thetrailing points.If this option isn't specified then Tk picks a ``reasonable'' shape..TP\fB\-capstyle \fIstyle\fRSpecifies the ways in which caps are to be drawn at the endpointsof the line.\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR(\fBbutt\fR, \fBprojecting\fR, or \fBround\fR).If this option isn't specified then it defaults to \fBbutt\fR.Where arrowheads are drawn the cap style is ignored..TP\fB\-fill \fIcolor\fR\fIColor\fR specifies a color to use for drawing the line; it may haveany of the forms acceptable to \fBTk_GetColor\fR. It may also be anempty string, in which case the line will be transparent.This option defaults to \fBblack\fR..TP\fB\-joinstyle \fIstyle\fRSpecifies the ways in which joints are to be drawn at the verticesof the line.\fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR(\fBbevel\fR, \fBmiter\fR, or \fBround\fR).If this option isn't specified then it defaults to \fBmiter\fR.If the line only contains two points then this option is
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -