Each rectangle is specified as two points:
(
,
x0
) is
the top left corner, and
(y0
,
x1
) is
the bottom right corner.y1
Rectangles are drawn in two parts:
The outline lies outside the canvas on its top and left sides, but inside the canvas on its bottom and right side. The default appearance is a 1-pixel-wide black outline.
The fill is the area inside the outline. Its default appearance is transparent.
To create a rectangle object on canvas
:C
id
=C
.create_rectangle (x0
,y0
,x1
,y1
,option
, ... )
This constructor returns the object ID of the rectangle on that canvas. Options include:
fill | By default, the interior of a rectangle is
empty, and you can get this behavior with
fill="" . You can also set
the option to a color; see Section 4.3, “Colors”. |
outline | The color of the border. Default is
outline="black" . |
stipple | A bitmap indicating how the interior of the
rectangle will be stippled. Default is
stipple="" , which
means a solid color. A typical value would be
stipple="gray25" . Has no
effect unless the fill has
been set to some color. See Section 4.7, “Bitmaps”. |
tags | The tags to be associated with the object, as a sequence of strings. See Section 6.1.4, “Canvas tags”. |
width | Width of the border. Default is 1 pixel.
Use width=0 to make the
border invisible. See Section 4.1, “Dimensions”. |