summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/node.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/starling/node.scm b/starling/node.scm
index 51866d2..efb3c12 100644
--- a/starling/node.scm
+++ b/starling/node.scm
@@ -46,7 +46,8 @@
child-ref
&
attach-to
- detach))
+ detach
+ blink))
(define-class <node> ()
;; Symbolic name. Used for easy lookup of children within a parent.
@@ -211,3 +212,19 @@ represented as a ratio in the range [0, 1]."
(define-method (detach . nodes)
"Detach all NODES from their respective parents."
(for-each detach nodes))
+
+
+;;;
+;;; Simple Script Actions
+;;;
+
+(define-method (blink (node <node>) times interval)
+ (let ((orig (visible? node)))
+ (let loop ((i 0))
+ (when (< i times)
+ (set! (visible? node) #f)
+ (sleep interval)
+ (set! (visible? node) #t)
+ (sleep interval)
+ (loop (+ i 1))))
+ (set! (visible? node) orig)))