[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

View-draw-contents and scrollers



I am really stumped by a redraw problem with a scroller.  I am trying to
make a scrolling view with a background color.  I have simplified the
problem down to this code:

(require 'scrollers)

(defclass test-view (ccl::scroller-mixin view)
    ())

(defmethod view-draw-contents ((my-test-view test-view))
    (with-slots (view-size view-position view-container)
                        my-test-view
         (with-focused-view view-container
                   (with-fore-color (random 10000)
                        (rlet ((r :rect 
                                :topleft view-position
                                :bottomright 
                                     (add-points view-position view-size)))
                           (#_paintrect r))))))


(setq foo1 (make-instance 'color-dialog))


(setq bar1 (make-instance 'test-view
                        :view-container foo1
                        :view-size #@(100 100)
                        :h-scrollp nil))


I expected that with each movement of the scrollbar thumb that the entire
view area would be redrawn in a new (random) color.  This does not occur. 
Only a portion of the view is redrawn (what appears to be as high as the
number of pixels the scrollbar thumb has moved).  What is going on here? 
Shouldn't the call to with-focused-view override the behavior I observed? 
What can I do to fix this?

Any and all help is appreciated.

Marc Davis


                                                                    Marc Davis
                                                             Interval Research
                                                         1801-C Page Mill Road
                                                           Palo Alto, CA 94304
                                                           TEL: (415) 354-3631
                                                           FAX: (415) 354-0872
                                                           
davis@interval.com