Overview of Item Types

Rectangle Items

Items of type rectangle appear as rectangular regions on the display. Each rectangle may have an outline (pen color), a fill, or both. Rectangles are created with widget commands of the following form:

pathName create rectangle x1 y1 x2 y2 [option value option value ...]

The arguments x1, y1, x2, and y2 give the coordinates of two diagonally opposite corners of the rectangle After the coordinates there may be any number of option-value pairs, each of which sets one of the configuration options for the item. These same option-value pairs may be used in itemconfigure widget commands to change the item's configuration. The following options are supported for rectangles:

[73] -fill color

(available only for handle, HTML, polygon, portal and rectangle item types)

Fill the area of the rectangle with color, which may be specified in any of the forms accepted by Tk_GetColor. If color is "none" (the default), then the rectangle will not be filled.

[74] -joinstyle join

(available only for line, polygon, rectangle and spline item types)

Specifies how the joints at vertices are drawn. join may be one of:


[75] -pen color

(available only for handle, line, polygon, portal, rectangle, spline, text and textfile item types)

Draw an outline around the edge of the rectangle in color. Color may have any of the forms accepted by Tk_GetColor. If color is "none", then no outline will be drawn for the rectangle. This option defaults to black.

[76] -penwidth width

(available only for line, polygon, rectangle and spline item types)

Width specifies the width of the pen in current units to be drawn around the item. Wide lines will be drawn centered on the path specified by the points. If width is 0.0, then the pen will always be drawn one pixel wide, independent of the zoom. Width defaults to 1 pixel.


July 9, 1996 - 9 JUL 1996

Generated with Harlequin WebMaker

Web Accessibility