home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / lisp / mcl / 1635 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: ccl:scrolling window bug?
  5. Message-ID: <9211191413.AA16053@cambridge.apple.com>
  6. Date: 19 Nov 92 15:17:13 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 54
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11. >I'm not sure if there is a reason for not doing this, but I've noticed
  12. >that the class ccl::scrolling-windows does not seem to set the update
  13. >region to exclude it's own scroll bars before it continues with the call
  14. >chain.  This means that any views inside of it will automatically draw
  15. >into the scroll bar area.  I'm assuming that the "view-draw-contents"
  16. >methods are all called with the appropriate "with-focused-view" or 
  17. >"with-focused-dialog-item" by the call chain (read that as I'm not
  18. >using this macro within my "view-draw-contents" methods since I assumed
  19. >all that is automatically handled).  Also note that resizing a scrolling
  20. >window is what brings out this view.  If I simply cover up the subview with
  21. >another window (such as the listener), then uncover it, the scroll bars
  22. >seem to be drawn properly.
  23. >
  24. >Is there a fix available for this or am I doing this wrong?
  25.  
  26. A SCROLLING-WINDOW instance does not expect any subviews besides the
  27. three it creates (a SCROLLER and two scroll bars). Hence, you need
  28. to change your example by making your TEST-VIEW class inherit from
  29. SCROLLER, and by passing a :SCROLLER-CLASS initarg to the MAKE-INSTANCE
  30. for the SCROLLING-WINDOW:
  31.  
  32. --------------------------------------------------------------------
  33.  
  34. (require "QUICKDRAW")
  35. (require "SCROLLING-WINDOWS")
  36.  
  37. ;; define a test class
  38. (defclass test-view (scroller)
  39.   nil)
  40.  
  41. ;; make this a separate routine, so we can move it around the call chain easily
  42. (defmethod draw-code ((me test-view))
  43.    (with-fore-color *yellow-color*
  44.     (paint-rect me 0 0 (point-h (view-size me)) (point-v (view-size me))))
  45.   (with-fore-color *red-color*
  46.     (move-to me 0 0)
  47.     (line-to me (point-h (view-size me)) (point-v (view-size me)))
  48.     (move-to me (point-h (view-size me)) 0)
  49.     (line-to me 0 (point-v (view-size me)))))
  50.  
  51. (defmethod view-draw-contents ((me test-view))
  52.   (draw-code me))
  53.  
  54. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  55. ;;
  56. ;; Create the window with a large subview in it
  57. ;;
  58.  
  59. (make-instance 'ccl::scrolling-window
  60.   :window-title "test"
  61.   :color-p t
  62.   :view-size #@(285 85)
  63.   :scroller-class 'test-view
  64.   :track-thumb-p t)                     ; real-time scrolling
  65.