home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / lisp / mcl / 1950 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.6 KB

  1. Path: sparky!uunet!stanford.edu!apple!cambridge.apple.com!sharp@newton.apple.com
  2. From: sharp@newton.apple.com
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: update events from tight loops?
  5. Message-ID: <9301080301.AA26740@newton.apple.com>
  6. Date: 8 Jan 93 03:04:22 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 36
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. Hiya,
  12.  
  13. I am creating a view item that increments or decrements a number when a
  14. button is clicked. I would like the button (inc and dec) to behave such
  15. that a click inc/decs by one, and holding the button continuously inc/decs
  16. (at some rate).
  17.  
  18. I can get the behaviour, but the view does not update. The key part is the
  19. looping structure below:
  20.  
  21. (defmethod view-click-event-handler ((self increment-button) where)
  22.   (declare (ignore where))
  23.   (let ((to-view (if (message-view self)
  24.                    (message-view self)
  25.                    (view-container self))))
  26.     (when to-view
  27.       (increment to-view)
  28.       (let ((start (rref *current-event* :EventRecord.when)))
  29.         ;; key bit
  30.         (loop
  31.           (unless (mouse-down-p)
  32.             (return))
  33.           (when (= (mod (- (#_TickCount) start) 20))
  34.             (increment to-view)
  35.             (WHAT GOES HERE????)))))))))
  36.  
  37. The WHAT GOES HERE? is where I need something that will cause LISP to allow
  38. invalidated views to update themselves.
  39.  
  40. Any suggestions?
  41.  
  42. maurice
  43. -------------------------------------------------------------------------
  44. Maurice Sharp             I #include <std_disclaimer.c>
  45. Apple Computer Inc.       |"Work for?! I don't work *for* anybody.
  46. Intern at Large           | I'm just having fun." -- The Doctor (#4)
  47.