From 5b3f63bee56ee8e67e57d38eb57bf5b378e1d716 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 27 Dec 2022 08:57:21 -0500 Subject: node: Inherit mixin. --- catbird/node.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/catbird/node.scm b/catbird/node.scm index 998fe58..c923f94 100644 --- a/catbird/node.scm +++ b/catbird/node.scm @@ -65,7 +65,7 @@ (define-class ( - ) + ) ;; An integer value that determines priority order for ;; updating/rendering. (rank #:accessor rank #:init-value 0 #:init-keyword #:rank #:observe? #t) @@ -182,6 +182,13 @@ (hashq-remove! (children-by-name p) (name node))) (next-method))) +(define-method (send (node ) message . args) + ;; Move up the tree to look for a handler for the message if the + ;; current node does not handle or consume the message. + (or (next-method) + (let ((p (parent node))) + (and p (apply send p message args))))) + (define-method (blink (node ) times interval) (let loop ((i 0)) (when (< i times) -- cgit v1.2.3