PtPolygon
![]() |
![]() |
![]() |
![]() |
PtPolygon
A set of connected line segments
Class hierarchy:
PtWidget → PtBasic → PtGraphic → PtPolygon
For more information, see the diagram of the widget hierarchy.
PhAB icon:

Public header:
<photon/PtPolygon.h>
Description:
You can use the PtPolygon widget to draw a set of connected line segments, called a polyline, from the vertices of the line segments.

Open or closed PtPolygon widgets.
The points that you specify in the Pt_ARG_POINTS resource are the vertices of the polyline or polygon. These points are relative to the widget's Pt_ARG_ORIGIN. For more information, see PtGraphic.
For a polygon, the last vertex doesn't have to be the same as the first; the widget can close the polygon for you.
You can use Pt_ARG_POLYGON_FLAGS to specify:
- whether points in the polygon definition are relative to the previous point or in absolute coordinates
- whether a polyline (open curve) or polygon (closed curve) is to be drawn.
New resources:
| Resource | C type | Pt type | Default |
|---|---|---|---|
| Pt_ARG_POLYGON_FLAGS | unsigned short | Flag | 0 |
Pt_ARG_POLYGON_FLAGS
| C type | Pt type | Default |
|---|---|---|
| unsigned short | Flag | 0 |
This resource defines the type of polygon to be drawn. You can OR the following flag bits (defined in <photon/Pg.h>):
- Pg_CLOSED
- Connect the last point to the first.
- Pg_POLY_RELATIVE
- Use relative coordinates to draw the polygon. Each point is relative to the previous point.
The default setting of this resource is 0; that is, no flags have been set.
Inherited resources:
If the widget modifies an inherited resource, the “Default override” column indicates the new value. This modification affects any subclasses of the widget.
![]() |
![]() |
![]() |
![]() |

![[Previous]](prev.gif)
![[Contents]](contents.gif)
![[Index]](keyword_index.gif)
![[Next]](next.gif)
