home *** CD-ROM | disk | FTP | other *** search
- 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
- From: bill@cambridge.apple.com (Bill St. Clair)
- Newsgroups: comp.lang.lisp.mcl
- Subject: Re: ccl:scrolling window bug?
- Message-ID: <9211191413.AA16053@cambridge.apple.com>
- Date: 19 Nov 92 15:17:13 GMT
- Sender: info-mcl-request@cambridge.apple.com
- Lines: 54
- Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
-
- >I'm not sure if there is a reason for not doing this, but I've noticed
- >that the class ccl::scrolling-windows does not seem to set the update
- >region to exclude it's own scroll bars before it continues with the call
- >chain. This means that any views inside of it will automatically draw
- >into the scroll bar area. I'm assuming that the "view-draw-contents"
- >methods are all called with the appropriate "with-focused-view" or
- >"with-focused-dialog-item" by the call chain (read that as I'm not
- >using this macro within my "view-draw-contents" methods since I assumed
- >all that is automatically handled). Also note that resizing a scrolling
- >window is what brings out this view. If I simply cover up the subview with
- >another window (such as the listener), then uncover it, the scroll bars
- >seem to be drawn properly.
- >
- >Is there a fix available for this or am I doing this wrong?
-
- A SCROLLING-WINDOW instance does not expect any subviews besides the
- three it creates (a SCROLLER and two scroll bars). Hence, you need
- to change your example by making your TEST-VIEW class inherit from
- SCROLLER, and by passing a :SCROLLER-CLASS initarg to the MAKE-INSTANCE
- for the SCROLLING-WINDOW:
-
- --------------------------------------------------------------------
-
- (require "QUICKDRAW")
- (require "SCROLLING-WINDOWS")
-
- ;; define a test class
- (defclass test-view (scroller)
- nil)
-
- ;; make this a separate routine, so we can move it around the call chain easily
- (defmethod draw-code ((me test-view))
- (with-fore-color *yellow-color*
- (paint-rect me 0 0 (point-h (view-size me)) (point-v (view-size me))))
- (with-fore-color *red-color*
- (move-to me 0 0)
- (line-to me (point-h (view-size me)) (point-v (view-size me)))
- (move-to me (point-h (view-size me)) 0)
- (line-to me 0 (point-v (view-size me)))))
-
- (defmethod view-draw-contents ((me test-view))
- (draw-code me))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; Create the window with a large subview in it
- ;;
-
- (make-instance 'ccl::scrolling-window
- :window-title "test"
- :color-p t
- :view-size #@(285 85)
- :scroller-class 'test-view
- :track-thumb-p t) ; real-time scrolling
-