Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!ncar!mailrus!eecae!cps3xx!usenet From: usenet@cps3xx.UUCP (Usenet file owner) Newsgroups: comp.sys.mac.programmer Subject: Re: Windows--HELP Message-ID: <873@cps3xx.UUCP> Date: 15 Oct 88 01:28:31 GMT References: <9569@swan.ulowell.edu> Reply-To: rang@cpswh.cps.msu.edu (Anton Rang) Distribution: na Organization: Michigan State University, Computer Science Dept. Lines: 38 In-reply-to: jkeegan@hawk.ulowell.edu's message of 11 Oct 88 05:46:00 GMT In article <9569@swan.ulowell.edu>, Jeffrey Keegan (jkeegan@hawk.ulowell.edu) writes: > If the window is dragged so that part of it is off the screen (and almost > every application I've seen that allows dragging windows allows parts of > them to be dragged off the screen), then scrolling can cause problems. > Specific example: you move the text window so the bottom half is off the > screen. Then you type enough text that the screen starts to scroll (I > handle scrolling with scrollrect, and draw all drawings to both an on > screen and off screen bitmap for update events), and it screws up. The > text that is still visible on the screen scrolls up fine, but none of the > text that was below the screen boundary scrolls up. This is a fairly common misconception about Macintosh windows. The only part of the window that contains data is the visible area--the window contents off-screen don't exist (unlike some other windowing systems, like the Amiga's [I think]). The trick is to keep the information in more than one place. Keep an array with the text in it (80x24, maybe). To scroll the window, you need to: 1. Call ScrollRect to update the visible portion. 2. Add the previously invisible portion to the update region. 3. Update the update region. You may want to update the previously invisible area directly, rather than relying on an update event (otherwise continuous scrolling would never update the screen). Red Ryder (10.3) delays the update, but eventually updates it (without necessarily waiting for a normal update event, I think--don't know details though, just how it appears). Hope this helps... Anton +----------------------------------+------------------------+ | Anton Rang (grad student) | "UNIX: Just Say No!" | | Michigan State University | rang@cpswh.cps.msu.edu | +----------------------------------+------------------------+