home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!wupost!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!minow
- From: minow@Apple.COM (Martin Minow)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Scrolling (was:what remains when the clothes fly off?)
- Keywords: ScrollRect()
- Message-ID: <71519@apple.Apple.COM>
- Date: 22 Aug 92 16:02:50 GMT
- References: <171f6mINN2g1@darkstar.UCSC.EDU> <sold.74.714428884@kit.uni-kl.de>
- Organization: Apple Computer Inc., Cupertino, CA
- Lines: 29
-
-
- gil@cse.ucsc.edu asks about scrolling pictures (using ScrollRect). One of
- the arguments to ScrollRect is a region handle. It is set to a region that
- describes the area that was uncovered. Now, you can do the following:
- ScrollRect(..., myInvalRgn);
- InvalRgn(myInvalRgn);
- and your application will get an update event. Your update event handler
- should then redraw the entire window (only the "invalid" part will change).
- You can get somewhat better performance by doing the update stuff yourself:
- ScrollRect(..., myInvalRgn);
- InvalRgn(myInvalRgn);
- BeginUpdate(myWindowPtr);
- DrawMyWindow(myWindowPtr);
- EndUpdate(myWindowPtr);
- This avoids the event-loop overhead. DrawMyWindow calls DrawControls,
- DrawGrowIcon, and then draws your application-specific content.
-
- Another possibility is to save the current clip region, set the clip
- region to myInvalRgn, and just draw the content, but I suspect that
- the BeginUpdate...EndUpdate sequence is more robust.
-
- Read through the description of regions in the QuickDraw chapter, and
- update event management in the Window Manager chapter -- both in Inside
- Mac volume 1.
-
- Good luck.
-
- Martin Minow
- minow@apple.com
-