Canvas

The canvas widget is used to display all kind of graphics output.
Graphic components are defined as objects like line, circle and
photoimage which are displayed on the canvas. These objects can be
modified through methods to change their appearance. The display and
redrawing is handled by the canvas widget automatically, so that the
user does not need to care for that. For convenience, ltk adds a
scrolled-canvas widget which contains a canvas widget and adds
automatically scrollbars to it. You gain access to the contained
canvas with the canvas method.

A canvas widget is created by the make-canvas function. It has
the optional arguments width and height for the width
and height used to display the canvas widget. The drawing region
itself can be bigger, its size is set by the scrollregion
method, which has the canvas and the dimension as the coordinates x0
y0 and x1 y1 as parameters.

Objects to be displayed in a canvas are created via the create-xxx methods, with xxx the
type of object to be created. They take the canvas as first argument and return an index
(integer) which is used as handle for the modifying functions.
A list of currently supported objects and the create method
parameters:

(create-arc canvas x0 y0 x1 y1 :start a1 :extent a2 :style style)

Creates an arc item. The arc angles are specified in starting angle
and extend of the arc. So a quater circle would have an extent of 90. Style determines
how the arc is rendered. Available styles are:

pieslice (default) Draw the ark as the slice of a pie, that is an arc with
2 lines to the center of the circle.

chord Draw the arc as an arc and a line connecting the end points of the arc.

arc Draw only the arc.

(create-bitmap canvas x y &key bitmap)

Creates an bitmap on the canvas, if bitmap is given, its displayed in this item.
Special configuration options are:

anchoranchorPos

bitmapbitmap

foregroundcolor

backgroundcolor

(create-image canvas x y &key image)

Creates an image on the canvas, if image is given, its displayed in this image.
Special configuration options are:

anchoranchorPos

imageimage

activeimageimage

disabledimageimage

(create-line canvas coords)

Coords is a list of the coordinates of the line in the form
(x0 y0 x1 y1 x2 y2 ...). Lines with any number of segments
can be created this way. Special configuration options for line
items (see itemconfigure) are:

arrowwhere one of none (no arrow), first (arrow
on first point of line), last and both.

arrowshapeshape

capstylestyle butt, projecting, or round.

joinstylestyle bevel, miter, or round.

smoothmethod 0 or bezier

splinestepsnumber Degree of smoothness if smooth is specified.

(create-line* canvas &rest coords)

Like create-line, but the coordinates are directly given in
the form x0 y0 x1 y1 x2 y2 .

(create-oval canvas x0 y0 x1 y1)

Creates an oval fitting within the rectangular of the given
coordinates.