[net.micro.mac] GrafPort Scrolling Question

kim@analog.UUCP (Kim Helliwell ) (03/19/85)

I am working on a Mac application and have the following question for anyone
who has gotten further than I have in understanding Mac arcana.

Consider a window with a vertical scroll bar and some text in it.  In order
to scroll the text when the scroll bar is manipulated, you merely call
TEScrollText (or something like that).  Now, suppose what you have in the
window is NOT merely the text of a single edit record, but several different
entities (different TE records, for example).  How does one scroll that stuff
around?

I have considered two approaches.  The first is to do a SetOrigin to move
the window's grafport where you want it and then repaint the window.  The 
catch is that that moves the scroll bar out of the window, too!  So what you
have to do is SetOrigin, paint, SetOrigin back to normal, and call DrawControls.
That quickly gets messy, esp if you want to use the mouse to point to and select
object anywhere in the window.

The second approach is to open an auxiliary GrafPort which you position over
the actual display area of the window, and use that for displaying and
manipulating the window contents and keep the window's GP intact for showing
the scroll bar.  Just describing this makes it sound like it's not going to
work!  Even if it did work, think about the mess you would have in moving
the window around on the screen!

Sooooo, how do you experts out there do this sort of thing?  There must be
a simpler way than I can see!