diff options
author | David Thompson <dthompson2@worcester.edu> | 2022-12-27 08:57:21 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2022-12-27 08:57:58 -0500 |
commit | 5b3f63bee56ee8e67e57d38eb57bf5b378e1d716 (patch) | |
tree | 04cdab8568445b41a1576c44fffe91110dffa179 | |
parent | 6b1cc0172be81b2c6790bc4460b1d0520d966123 (diff) |
node: Inherit <listener> mixin.
-rw-r--r-- | catbird/node.scm | 9 |
1 files changed, 8 insertions, 1 deletions
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 <node> (<renderable> <scriptable> <containable> <nameable> <rankable> - <observer> <asset-container>) + <observer> <listener> <asset-container>) ;; 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 <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 <node>) times interval) (let loop ((i 0)) (when (< i times) |