A more generic and complex event type can be created via the bind function. With it for any widget type events can be defined, the function bound to it always needs to accept one parameter an event structure. Its usage is: (bind widget event function)1
A scribble example:
(defun scribble () (with-ltk () (let* ((canvas (make-instance 'canvas)) (down nil)) (pack canvas) (bind canvas "<ButtonPress-1>" (lambda (evt) (setf down t) (create-oval canvas (- (event-x evt) 10) (- (event-y evt) 10) (+ (event-x evt) 10) (+ (event-y evt) 10)))) (bind canvas "<ButtonRelease-1>" (lambda (evt) (declare (ignore evt)) (setf down nil))) (bind canvas "<Motion>" (lambda (evt) (when down (create-oval canvas (- (event-x evt) 10) (- (event-y evt) 10) (+ (event-x evt) 10) (+ (event-y evt) 10))))))))