aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/02-moving-bitmp.lisp8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/02-moving-bitmp.lisp b/examples/02-moving-bitmp.lisp
index 3a7fbc9..53f9229 100644
--- a/examples/02-moving-bitmp.lisp
+++ b/examples/02-moving-bitmp.lisp
@@ -62,7 +62,13 @@
(ww::on-mousemotion ()
(print (list target x y xrel yrel state))))
+(ww::defhandler look-at-me
+ (ww::on-focus ()
+ (format t "~a got focus~%" target)))
+(ww::defhandler look-away
+ (ww::on-blur ()
+ (format t "~a lost focus~%" target)))
(defmethod ww::boot ((app bitmap-display))
(let ((bm
@@ -82,6 +88,8 @@
(ww::unit-y bm2) 90)
(ww::set-handler bm2 #'move-thing)
(ww::set-handler bm2 #'thing-clicked)
+ (ww::set-handler bm2 #'look-at-me )
+ (ww::set-handler bm2 #'look-away)
(ww::add-unit app bm2)))