• 検索結果がありません。

Canvas Item Commands

ドキュメント内 tcl tk reference guide (ページ 62-67)

See Canvas Item Standard Options above for item standard options below.

Command Description

pathName create arc ?x1 y1 x2 y2?

?coordList?

?option value ...?

Display an arc-shaped region (oval delimited by two angles specified by -start and -extent options). Args x1,y1 and x2,y2 or coordList give the coordinates of two diagonally opposite corners of a rectangular region enclosing the oval that defines the arc. Options are:

-dash -activedash -disableddash -dashoffset

-fill -activefill -disabledfill

-outline -activeoutline -disabledoutline -outlinestipple -activeoutlinestipple -disabledoutlinestipple -stipple -activestipple -disabledstipple -offset -width -activewidth -disabledwidth

-state -tags

Arc Specific Options:

-extent degrees

Size of the angular range occupied by arc in degrees (range = ±360, if outside range then degrees modulo 360) counter-clockwise from -start angle.

-start degrees

Starting angle (±) measured from 3-o’clock position.

-style type

Arc is drawn as either type pieslice (default) where the enclosed region is a section of the perimeter and two lines from the center to the perimeter endpoints; chord where the enclosed region is a section of the perimeter and a line connecting the perimeter endpoints; or arc where the enclosed region is just a section of the perimeter.

pathName create bitmap

?x y?

?coordList?

?option value ...?

Display a bitmap at positioning point coordinates of x,y or coordList. Options are:

-state -tags

Bitmap Specific Options:

-anchor anchorPos Specifies how to position bitmap relative to item positioning point where anchorPos is n, ne, e, se, s,sw,w ,nw, or center (default).

-background color Specifies color to use for background in normal state. If not specified or set to an empty string, then background is transparent. See Colors in Options and Resources for color options.

-activebackgroundcolor (Tk 8.4+) Specifies color to use for background in active state.

-disabledbackgroundcolor (Tk 8.4+) Specifies color to use for background in disabled state.

-bitmap bitmap Specifies the bitmap to display in the normal state. See Default Bitmaps in Options and Resources for bitmap options.

-activebitmap bitmap (Tk 8.4+) Specifies the bitmap to display in the active state.

-disabledbitmap bitmap (Tk 8.4+) Specifies the bitmap to display in the disabled state.

-foreground color Specifies color to use (default is black) for foreground in normal state. See Colors in Options and Resources for color options.

-activeforegroundcolor (Tk 8.4+) Specifies color to use for foreground in active state.

-disabledforegroundcolor (Tk 8.4+) Specifies color to use for foreground in disabled state.

pathName create image

?x y?

?coordList?

?option value ...?

Display an image at positioning point coordinates of x,y or coordList .Options are:

-state -tags

Image Specific Options:

-anchor anchorPos Specifies how to position the image relative to the item positioning point whereanchorPos is n, ne, e, se, s,sw ,w,nw, or center (default).

-image image Specifies the image to display in the normal state.

-activeimageimage (Tk 8.4+) Specifies the image to display in the active state.

-disabledimage image

(Tk 8.4+) Specifies the image to display in the disabled state.

pathName create line

?x1 y1 ... xN yN?

?coordList?

?option value ...?

Display one or more connected line segments or curves. Args x1,y1 through xN,yN or coordList give the coordinates for a series of two or more points that describe a series of connected line segments. Options are:

-dash -activedash -disableddash -dashoffset -fill -activefill -disabledfill

-stipple -activestipple -disabledstipple -width -activewidth -disabledwidth -state

-tags

Line Specific Options:

-arrow where

Specifies whether an arrowhead should be drawn at line endpoints. Options are: none (default option for no arrowheads), first (for an arrowhead at the first point of the line), last (for an arrowhead at the last point of the line), or both (for arrowheads at both ends).

-arrowshape shape

Specifies arrowhead shape where shape is a three element list (neck length to tip, trailing point length to tip, width from line to trailing point). Default is a reasonable shape. See Coordinates in Options and Resources for screen unit options.

-capstyle style Specifies caps to be drawn at endpoints of the line. Style options are: butt (default), projecting, or round. Superceded by -arrow.

-joinstyle style Specifies joints to be drawn at line verticies. Style options are: bevel ,miter, or round.

-smooth smoothMethod

Set to true or bezier, smoothing is used to draw the line as a curve. The line is rendered as a set of parabolic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated by duplicating the end-points of the desired line segment. Set to false or {}, no smoothing is performed. In Tk 8.5+, set to raw, indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve.

-splinesteps number

Specifies degree of smoothness desired for curves by approximating spline over number line segments. Used with -smooth true or raw.

pathName create oval

?x1 y1 x2 y2?

?coordList?

?option value ...?

Display an oval region. Args x1,y1 and x2,y2 or coordList give the coordinates of two diagonally opposite corners of a rectangular region enclosing the oval. The oval includes the top and left edges but not bottom and right edges. Options are:

-dash -activedash -disableddash -dashoffset

-fill -activefill -disabledfill

-outline -activeoutline -disabledoutline -outlinestipple -activeoutlinestipple -disabledoutlinestipple -stipple -activestipple -disabledstipple -offset -width -activewidth -disabledwidth

-state -tags

pathName create polygon ?x1 y1 ... xN yN?

?coordList?

?option value ...?

Display a polygonal or curved filled region. Args x1,y1 through xN ,yN or coordList give the coordinates of three or more points that define a polygon. The first point is not repeated as the last point. Options are:

-dash -activedash -disableddash -dashoffset

-fill -activefill -disabledfill

-outline -activeoutline -disabledoutline -outlinestipple -activeoutlinestipple -disabledoutlinestipple -stipple -activestipple -disabledstipple -offset -width -activewidth -disabledwidth

-state -tags

Polygon Specific Options:

-joinstyle style

(Tk 8.4+) Specifies joints to be drawn at outline verticies. Style options are: bevel, miter, or round.

-smooth boolean

Set to true, bezier smoothing is used to draw the outline as a curve. The line is rendered as a set of parabolic splines: one spline is drawn for the first and second line segments, one for the second and third, and so on. Straight-line segments can be generated by duplicating the end-points of the desired line segment. Set to false or {}, no smoothing is performed.

In Tk 8.5+, set to raw, indicates that the line should also be drawn as a curve but where the list of coordinates is such that the first coordinate pair (and every third coordinate pair thereafter) is a knot point on a cubic Bezier curve, and the other coordinates are control points on the cubic Bezier curve.

-splinesteps number

Specifies degree of smoothness desired for outline curves by approximating spline over number line segments. Used with -smooth true or raw.

pathName create rectangle ?x1 y1 x2 y2?

?coordList?

?option value ...?

Display a rectangular region. Args x1,y1 and x2,y2 or coordList give the coordinates of two diagonally opposite corners of the rectangle. The rectangle includes the top and left edges but not bottom and right edges. Options are:

-dash -activedash -disableddash -dashoffset

-fill -activefill -disabledfill

-outline -activeoutline -disabledoutline -outlinestipple -activeoutlinestipple -disabledoutlinestipple -stipple -activestipple -disabledstipple -offset -width -activewidth -disabledwidth

-state -tags

pathName create text ?x y? ?coordList?

?option value ...?

Display a string of characters in one or more lines at positioning point coordinates of x,y or coordList.

Options are:

-fill -activefill -disabledfill -stipple -activestipple -disabledstipple -state

-tags

Text Specific Options:

-anchor anchorPos

Specifies how to position the text relative to the item positioning point where anchorPos is n, ne, e, se, s,sw ,w,nw, or center (default).

-font fontName

Specifies the font to use for the text item. See Fonts for font options. Default is system dependent.

-justify how Specifies how to justify multiple text lines within its bounding region. How options are:

left, right, or center.

-text string Specifies the characters to be displayed in the text item. Newline causes line break.

-width lineLength

Specifies the maximum line length for the text. If zero (default), break only on newline, otherwise break on last space before maximum line length. See Coordinates in Options and Resources for screen unit options.

pathName create window ?x y?

?coordList?

?option value ...?

Display a window at positioning point coordinates of x,y or coordList . It is not possible to draw other graphical items on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list. Options are:

-state -tags

Window Specific Options:

-anchor anchorPos

Specifies how to position the window relative to the item positioning point where anchorPos is n, ne, e, se,s ,sw,w,nw, or center (default).

-height height Height in screen units to assign item’s window. See Coordinates in Options and Resources for screen unit options.

-width width Width in screen units to assign item’s window. See Coordinates in Options and Resources for screen unit options.

-window pathName

Specifies the window pathName to associate with this item. The window must be either a child of the canvas widget or a child of some ancestor of the canvas widget and not a top-level window.

3.4 Checkbutton

Command Description

ドキュメント内 tcl tk reference guide (ページ 62-67)

関連したドキュメント