Next / Previous / Contents / TCC Help System / NM Tech homepage

6.9. The canvas rectangle object

Each rectangle is specified as two points: (x0, y0) is the top left corner, and (x1, y1) is the bottom right corner.

Rectangles are drawn in two parts:

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:

fillBy 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”.
outlineThe color of the border. Default is outline="black".
stippleA 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”.
tagsThe tags to be associated with the object, as a sequence of strings. See Section 6.1.4, “Canvas tags”.
widthWidth of the border. Default is 1 pixel. Use width=0 to make the border invisible. See Section 4.1, “Dimensions”.