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

Can anyone help me understand window updates? (repeat)



I sent this to comp.lang.lisp.mcl, but no one responded, so I thought I'd
try here.

Subject: Can anyone help me understand window updates?
From: Rob Browning, osiris@cs.utexas.edu
Date: 21 Jun 1994 23:36:30 GMT
In article <2u7thu$9j7@geraldo.cc.utexas.edu> Rob Browning,
osiris@cs.utexas.edu writes:
>
>I was trying to set up a window that had a vertical scrollbar.  (Yes I
>know about the scroller code, but I want one that updates the contents of
>the window _after_ it draws the scroll bar, because updates take a while.)
>
>When I try to do this in the naive way, the code that I use to draw the
>window overwrites the scroll bar and grow box.  This is because when
>view-draw contents is called, the clip region is set to the entire window.
>
>I only wanted to make the clip region a little smaller to exclude the
>scroll bar before I start drawing.  However, I cannot seem to accomplish
>this.  My first try was to call validate-corners on the bounding
>rectangle
>of the scroll bar before I started drawing like this
>
>(defmethod view-draw-contents ((win rt-win....))
>
>       (multiple-value-bind (scroll-tl scroll-br)
>                                  (view-corners (rt-win-scroller win))
>               (validate-corners win scroll-tl scroll-br)
>               ...draw...
>               ...))
>
>However, this does not work.  I assume because the validate-corners only
>has an effect on the next call to view-draw-contents.
>
>So I tried clip-rect:
>
>(defmethod view-draw-contents ((win rt-win....))
>
>       (multiple-value-bind (scroll-tl scroll-br)
>                                  (view-corners (rt-win-scroller win))
>               (clip-rect win scroll-tl scroll-br)
>               ...draw...
>               ...))
>
>But this does not work either.  In fact I found that clip-rect does
>nothing for the higher level quickdraw commands like line, frame-oval,
>etc.  Why?
>
>So, my ultimate question is, once you are inside your view-draw-contents
>method, is there any way to affect the clip region for the window so that
>subsequent higher level quickdraw calls like (frame-oval win 0 0 200 200)
>will be affected?
>
>--Rob.