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

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!wupost!usc!elroy.jpl.nasa.gov!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!jbk@world.std.com
  2. From: jbk@world.std.com (Jeffrey B Kane)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: ccl:scrolling window bug?
  5. Message-ID: <199211171805.AA08636@world.std.com>
  6. Date: 17 Nov 92 18:05:04 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 81
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11.  
  12. I'm not sure if there is a reason for not doing this, but I've noticed
  13. that the class ccl::scrolling-windows does not seem to set the update
  14. region to exclude it's own scroll bars before it continues with the call
  15. chain.  This means that any views inside of it will automatically draw
  16. into the scroll bar area.  I'm assuming that the "view-draw-contents"
  17. methods are all called with the appropriate "with-focused-view" or 
  18. "with-focused-dialog-item" by the call chain (read that as I'm not
  19. using this macro within my "view-draw-contents" methods since I assumed
  20. all that is automatically handled).  Also note that resizing a scrolling
  21. window is what brings out this view.  If I simply cover up the subview with
  22. another window (such as the listener), then uncover it, the scroll bars
  23. seem to be drawn properly.
  24.  
  25. Is there a fix available for this or am I doing this wrong?
  26.  
  27.             Jeffrey
  28.  
  29.  
  30. ;; define a test class
  31. (defclass test-view (view)
  32.   nil)
  33.  
  34. ;; make this a separate routine, so we can move it around the call chain easily
  35. (defmethod draw-code ((me test-view))
  36.    (with-fore-color *yellow-color*
  37.     (paint-rect me 0 0 (point-h (view-size me)) (point-v (view-size me))))
  38.   (with-fore-color *red-color*
  39.     (move-to me 0 0)
  40.     (line-to me (point-h (view-size me)) (point-v (view-size me)))
  41.     (move-to me (point-h (view-size me)) 0)
  42.     (line-to me 0 (point-v (view-size me)))))
  43.  
  44. ;;
  45. ;; specialize various methods to see where the problem is
  46. ;;
  47.  
  48. ;; try the around method
  49. (defmethod view-draw-contents :around ((me test-view))
  50.   ;; I tried inserting the draw-code here, both before and after
  51.   ;; the call-next-method with no change
  52.   (call-next-method)
  53.   (draw-code me))
  54.  
  55. ;; try the primary method
  56. (defmethod view-draw-contents ((me test-view))
  57.   ;; I tried inserting the draw-code here, both before and after
  58.   ;; the call-next-method with no change
  59.   (call-next-method))
  60.  
  61.  
  62. (defmethod view-draw-contents :after ((me test-view))
  63.  ;; the drawing does not good here either
  64. )
  65.  
  66. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  67. ;;
  68. ;; Create the window with a large subview in it
  69. ;;
  70.  
  71. (make-instance 'ccl::scrolling-window
  72.   :window-title "test"
  73.   :color-p t
  74.   :view-size #@(300 100)
  75.   :view-subviews
  76.   (list (make-instance 'test-view
  77.           :view-position #@(20 20)
  78.           :view-size #@(300 100))))
  79.  
  80.  
  81.  
  82.  
  83.  
  84. ======================================
  85. Jeffrey Kane, MD
  86. Kane Biomedical Systems
  87. Boston, MA
  88.  
  89. Internet           jbk@world.std.com
  90. Compuserve  74206,640
  91. AppleLink     D0738
  92.