The function canvastest demonstrates the basic canvas usage:
(defun canvastest() (with-ltk () (let* ((sc (make-instance 'scrolled-canvas)) (c (canvas sc)) (line (create-line c (list 100 100 400 50 700 150))) (polygon (create-polygon c (list 50 150 250 160 250 300 50 330 ))) (text (create-text c 260 250 "Canvas test"))) (pack sc :expand 1 :fill :both) (scrollregion c 0 0 800 800) )))
Methods:
Appends txt to the widgets content. If given, tag is the tag to be associated with the appended text.
Clear the content of the widget.
Get the content of the widget.
Set the content of the widget.
Ensure that pos is within the displayed area.
Configure a tag of the text widget.
Bind event to the specified tag of the widget, calling fun when the event occurs.
Write the content of the widget to the file named by filename. Note: filename is a string to be interpreted by tcl/tk on the client computer.
Loads the content of the widget from the file named by filename. Note: filename is a string to be interpreted by tcl/tk on the client computer.