aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-23 09:28:13 -0500
committerColin Okay <colin@cicadas.surf>2022-06-23 09:28:13 -0500
commitc03373741557666526202f7dc5150d82073f6f81 (patch)
tree4ef7ea02634533adb0a9c5e427f05a1409bbfb22 /examples
parent76d137475350287f6eddf7083ff0b7507a305e8c (diff)
[add] mousemotion handlers; [modify] app subclass interactive
Diffstat (limited to 'examples')
-rw-r--r--examples/02-moving-bitmp.lisp7
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