Next: Canvas Tags
Up: The Canvas Widget
Previous: Canvas Item Configurations
The following are the types of canvas items:
- Arc: a section of an oval, given by the start angle and
the length (configurations start and extent).
- BitmapItem and ImageItem: canvas items given
by bitmaps and images. The image of an image item is set with the
HasPhoto class, just like for some widgets.
- LineItem: a line item is given by a list of two or more
points, which define a list of line segments. The segments can be
joined in various ways (with the joinstyle configuration),
you can draw splines (class
CanvasItem.SegmentedCanvasItemSegmentedCanvasItem), and put arrows on either (or both) ends (configurations arrowshape and arrowstyle).
- Oval: an oval is given by defining its bounding
box, i.e. the smallest rectangle enclosing it, using the classes
HasGeometry or HasPosition and HasSize.
If the bounding box is a square, the oval is a
circle.
- Polygon: a polygon is given by a list of
vertices. Strangely, one cannot configure the join style of the
polygon, but you can configure splines.
- Rectangle: a rectangle is given by two points.
- TextItem: a text item is a text, possibly consisting of
more than one line. It is an instance of HasFont. (Note
that HTK curently does not support Tk's selection and insertion
methods for text items; it should be easy to add, if you really
require that.)
- EmbeddedCanvasWin: an embedded canvas window is a
widget embedded into a canvas. All instances of class
Widget can be embedded into a canvas. Note that you don't
need to pack embedded widgets; they appear as soon as the embedded
canvas window is created.
Figure 5: Canvas items:
a text item, three image items, a line item, an arc and an
embedded window (a button).
Next: Canvas Tags
Up: The Canvas Widget
Previous: Canvas Item Configurations
Christoph Lueth
Wed May 29 13:20:38 MEST 2002