[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
update events from tight loops?
- To: info-mcl@cambridge.apple.com
- Subject: update events from tight loops?
- From: sharp@newton.apple.com
- Date: Thu, 7 Jan 1993 19:04:22 -0800
Hiya,
I am creating a view item that increments or decrements a number when a
button is clicked. I would like the button (inc and dec) to behave such
that a click inc/decs by one, and holding the button continuously inc/decs
(at some rate).
I can get the behaviour, but the view does not update. The key part is the
looping structure below:
(defmethod view-click-event-handler ((self increment-button) where)
(declare (ignore where))
(let ((to-view (if (message-view self)
(message-view self)
(view-container self))))
(when to-view
(increment to-view)
(let ((start (rref *current-event* :EventRecord.when)))
;; key bit
(loop
(unless (mouse-down-p)
(return))
(when (= (mod (- (#_TickCount) start) 20))
(increment to-view)
(WHAT GOES HERE????)))))))))
The WHAT GOES HERE? is where I need something that will cause LISP to allow
invalidated views to update themselves.
Any suggestions?
maurice
-------------------------------------------------------------------------
Maurice Sharp I #include <std_disclaimer.c>
Apple Computer Inc. |"Work for?! I don't work *for* anybody.
Intern at Large | I'm just having fun." -- The Doctor (#4)