Overview of Item Types

Polygon Items

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

pathName create polygon x1 y1... xn yn [option value option value ...]

The arguments x1, y1, ..., xn, and yn specify the coordinates of the vertices of the polygon. 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 polygons:

[59] -fill color

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

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

[60] -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:


[61] -pen color

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

Draw an outline around the edge of the polygon 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.

[62] -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