Polygon Items |
||||
|
Items of type polygon appear as polygonal or curved filled regions on the display. Polygon items support coordinate indexing operations using the canvas widget commands: dchars, index, insert. Polygons are created with widget commands of the following form: (#<widget> 'create 'polygon x1 y1 ... xn yn ?option value option value ...?) (#<widget> 'create 'polygon coordList ?option value option value ...?) The arguments x1 through yn or coordList specify the coordinates for three or more points that define a polygon. The first point should not be repeated as the last to close the shape; Tk will automatically close the periphery between the first and last points. 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 standard options are supported by polygons: #:dash #:activedash #:disableddash #:dashoffset #:fill #:activefill #:disabledfill #:offset #:outline #:activeoutline #:disabledoutline #:outlinestipple #:activeoutlinestipple #:disabledoutlinestipple #:stipple #:activestipple #:disabledstipple #:state #:tags #:width #:activewidth #:disabledwidth The following extra options are supported for polygons:
Polygon items are different from other items such as rectangles, ovals and arcs in that interior points are considered to be ``inside'' a polygon (e.g. for purposes of the find closest and find overlapping widget commands) even if it is not filled. For most other item types, an interior point is considered to be inside the item only if the item is filled or if it has neither a fill nor an outline. If you would like an unfilled polygon whose interior points are not considered to be inside the polygon, use a line item instead. |