scheduling in sawfish (another porting from scwm issue)



Another thing I do in scwm for automating and testing applications is
scheduling things - send some keystrokes to a window, wait 5 seconds &
do it again.  This is done using add-timer-hook!, as in:

   ;;; Run (FUNC 1), (FUNC 2), ... (FUNC N), but once every TIME
   ;;; milliseconds.
   (define (do-every n time func)
     (if (> n 0)
	 (func n))
     (if (> n 1)
	 (add-timer-hook! time
			  (lambda ()
			    (do-every (- n 1) time func)))))

The point of the timer hook is to schedule work for later without
tying up the repl in a delay loop (which would freeze the window
manager).  I need it because for some applications I can't just push
all of the keystrokes - I need to wait for certain activities to
complete before proceeding. Is anything like this available in
sawfish?  If sawfish managed window events in a separate threads then
this wouldn't be necessary, but testing indicates that this isn't the
case.

Thanks,

-- 
Harvey Stein
Bloomberg LP
hjstein bloomberg com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]