diff options
author | Colin Okay <colin@cicadas.surf> | 2022-06-23 09:28:13 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-06-23 09:28:13 -0500 |
commit | c03373741557666526202f7dc5150d82073f6f81 (patch) | |
tree | 4ef7ea02634533adb0a9c5e427f05a1409bbfb22 /examples/02-moving-bitmp.lisp | |
parent | 76d137475350287f6eddf7083ff0b7507a305e8c (diff) |
[add] mousemotion handlers; [modify] app subclass interactive
Diffstat (limited to 'examples/02-moving-bitmp.lisp')
-rw-r--r-- | examples/02-moving-bitmp.lisp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp index 4706d1b..5d33de8 100644 --- a/examples/02-moving-bitmp.lisp +++ b/examples/02-moving-bitmp.lisp @@ -29,6 +29,10 @@ (ww::on-mousedown (unit x y clicks button) (format t "~a was clicked at ~a,~a!~%" unit x y))) +(ww::defhandler mouse-over + (ww::on-mousemotion (target x y xrel yrel state) + (print (list target x y xrel yrel state)))) + (defmethod ww::boot ((app bitmap-display)) (let ((bm (make-instance 'ww::bitmap @@ -39,7 +43,8 @@ ;; first (ww::refocus-on bm) (ww::set-handler bm #'move-thing) - (ww::set-handler bm #'thing-clicked ) + (ww::set-handler bm #'thing-clicked) + (ww::set-handler bm #'mouse-over) (ww::add-unit app bm) ;;second (setf (ww::unit-x bm2) 90 |