Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Windows--HELP Message-ID: <5645@hoptoad.uucp> Date: 15 Oct 88 18:14:48 GMT References: <9569@swan.ulowell.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 33 Quoth Jeff Keegan: "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. In addition, usually garbage is scrolled up instead (if I play around with the visrgn and cliprgn fields of the grafport).. Also, playing around with those usually upsets the lower rounded corners of the screen." The problem is you're messing with the visRgn. Never, ever touch it! It is the foundation of both the Window manager and MultiFinder's Layer Manager. The only legitimate operations on the visRgn are read-only operations -- for instance, sometimes you want to know if the window is visible (as opposed to shown), so you can test the visRgn for emptiness; also, you have to pass it to a list manager routine, which is dumb, but there it is. Apple's current guidelines explicitly forbid messing about with the visRgn. The text below the screen boundary won't scroll up; if you read the ScrollRect description, you will see that the area opened up is filled with the window's background pattern (usually white). You have to fill in the area yourself. If you pass the updateRgn of the window to ScrollRect, it will generate an update event for that area and your ordinary update handling will take care of it; but it's usually better just to pass a null region which you throw away, and to fill in the region explicitly after the ScrollRect. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "I wrapped a newspaper round my head, so I'd look like I was deep. I said some mumbo-jumbos then: I told him he was going to sleep. I robbed his ring, his pocket watch, and everything else I found. I had that sucker hypnotized; he didn't even make a sound!" - Frank Zappa, "Kozmik Debris"