;;;; animate.stk -- A simple image animation (Demo) ;;;; ;;;; Copyright © 1998-1999 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; Permission to use, copy, modify, distribute,and license this ;;;; software and its documentation for any purpose is hereby granted, ;;;; provided that existing copyright notices are retained in all ;;;; copies and that this notice is included verbatim in any ;;;; distributions. No written agreement, license, or royalty fee is ;;;; required for any of the authorized uses. ;;;; ;;;; This software is provided ``AS IS'' without express or implied ;;;; warranty. ;;;; ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 9-Mar-1998 18:51 ;;;;Last file update: 3-Sep-1999 18:45 (eg) (define *img* #f) (define (make-animation pattern parent delay) (let* ((files (sort (glob pattern) string= delay 0) (when (winfo (quote exists) widget) (if (>= i size) (set! i 0)) (tk-set! widget :image (vector-ref images i)) (set! i (+ i 1)) (update) (after (abs delay) anim)) (after 100 anim)))))) (after 'idle anim)) widget)) (define (change-animation-delay w delay) (let ((env (tk-get w :env))) (eval `(set! delay ,delay) env)))