diff options
author | colin <colin@cicadas.surf> | 2024-12-14 12:29:29 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-12-14 12:29:29 -0800 |
commit | 543704f0f54cbb1de78754ad8a323c482ab6829c (patch) | |
tree | 7528c0105516a2a2800e432de9f4f1a6c3fe506e /gui/menus.lisp | |
parent | 3a2217263d581be9a7f629b10d75aa8e3d581890 (diff) |
Diffstat (limited to 'gui/menus.lisp')
-rw-r--r-- | gui/menus.lisp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gui/menus.lisp b/gui/menus.lisp index a477dd9..e9188f1 100644 --- a/gui/menus.lisp +++ b/gui/menus.lisp @@ -11,7 +11,7 @@ :required :type region)) (defmethod cleanup :after ((menu menu)) - (loop for item in (menu-items menu) do (cleanup item))) + (map 'nil #'cleanup (menu-items menu))) (defmethod initialize-instance :after ((menu menu) &key) (with-slots (base-width base-height region) menu @@ -32,12 +32,12 @@ (macrolet ((def-menu-accessors (&rest accessor-names) (let ((defs - (loop for name in accessor-names - collect + (loop :for name :in accessor-names + :collect `(defmethod ,name ((menu menu)) (,name (unit-region menu))) - collect + :collect `(defmethod (setf ,name) (newval (menu menu)) (let ((diff (- newval (,name menu)))) (setf (,name (unit-region menu)) newval) @@ -96,9 +96,9 @@ (defmethod (setf vert-scroll) :after (val (vs vscroller)) (loop - for o in (menu-items vs) - for y = (+ (y vs) (height vs) val) then (- y (height o)) - do (setf (y o) y))) + :for o :in (menu-items vs) + :for y := (+ (y vs) (height vs) val) :then (- y (height o)) + :do (setf (y o) y))) (defhandler vscroller-scroll (on-mousewheel (vs horiz vert) @@ -110,7 +110,7 @@ (- oh h)))))) (defun vscroller-items-height (vs) - (loop for o in (menu-items vs) summing (height o))) + (loop :for o :in (menu-items vs) :summing (height o))) (defmethod add-menu-item :before ((vs vscroller) item) (setf (x item) (x vs) |