From d92ad0e6b07d55287179ea3f9584e4923c3f34f8 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 24 Jun 2022 08:39:31 -0500 Subject: [add] focusablep to interactive --- wheelwork.lisp | 8 +++++--- 1 file 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)) -- cgit v1.2.3