aboutsummaryrefslogtreecommitdiffhomepage
path: root/wheelwork.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-06-24 08:39:31 -0500
committerColin Okay <colin@cicadas.surf>2022-06-24 08:39:31 -0500
commitd92ad0e6b07d55287179ea3f9584e4923c3f34f8 (patch)
tree543a1a14941e9e27fcd6b5cdc0886b609b14c382 /wheelwork.lisp
parent1737ca0627d5fb75a4e74c8ee0562f734ce34ebf (diff)
[add] focusablep to interactive
Diffstat (limited to 'wheelwork.lisp')
-rw-r--r--wheelwork.lisp8
1 files changed, 5 insertions, 3 deletions
diff --git a/wheelwork.lisp b/wheelwork.lisp
index d8637f1..fb4e5bb 100644
--- a/wheelwork.lisp
+++ b/wheelwork.lisp
@@ -70,7 +70,8 @@ necessary."
are keyed by UNIT and hold Event-Handler instances."))
(defclass/std interactive ()
- ((listener :type (or null listener) :std nil :a))
+ ((listener :type (or null listener) :std nil :a)
+ (focusablep :std t :doc "Whether or not this object can receive application focus."))
(:documentation "Supplies an object with a listener slot."))
(defun listener-table-for (listener event-type)
@@ -339,8 +340,9 @@ necessary."
(defun refocus-on (target &optional (app *application*))
- "Sets focus of application to target"
- (setf (application-focus app) target))
+ "Sets focus of application to TARGET, if TARGET is focusable. "
+ (when (focusablep target)
+ (setf (application-focus app) target)))
(defun get-focus (&optional (app *application*))
(or (application-focus app) app))