From 9379c6520bf3c16e971eb6d8b33769854259da4e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 12 Jun 2019 17:01:08 -0400 Subject: node: Add run-script and stop-scripts methods. --- starling/node.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/starling/node.scm b/starling/node.scm index d3dc129..b21d5c6 100644 --- a/starling/node.scm +++ b/starling/node.scm @@ -48,6 +48,8 @@ & attach-to detach + run-script + stop-scripts blink)) (define-class () @@ -220,9 +222,15 @@ represented as a ratio in the range [0, 1]." ;;; -;;; Simple Script Actions +;;; Scripting ;;; +(define-syntax-rule (run-script node body ...) + (with-agenda (agenda node) (script body ...))) + +(define-method (stop-scripts node) + (with-agenda (agenda node) (clear-agenda))) + (define-method (blink (node ) times interval) (let ((orig (visible? node))) (let loop ((i 0)) -- cgit v1.2.3