Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!dlyons From: dlyons@Apple.COM (David Lyons) Newsgroups: comp.sys.apple Subject: Re: 2 more IIGS programming questions Message-ID: <32779@apple.Apple.COM> Date: 29 Jun 89 06:42:37 GMT References: <9760@boulder.Colorado.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 50 In article <9760@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) writes: >1) >I've been having a problem getting a new desk accessory which needs to use >Standard File (SF) to work. The problem occurs when, since SF is not >assumed to be loaded, I need to load and start it up. Here is the TML >Pascal code I use to do it: > > > ToolRec.NumTools := 12; {number of tools needed to load} > ToolRec.Tools[1].TSNum := 23; {Standard File} > ToolRec.Tools[1].MinVersion := 0; It would be really helpful if that "12" was a "1" instead. > SFStartUp(MemID, LoWord(ToolsZeroPage^) + $700); Congratulations! You've just fed Standard File a direct-page location $700 bytes *after* the space you allocated for it. ACK! Remove the "+$700" part, and promise to be more careful when you cut and paste code from another application! By the way, you must load and use Standard File *when you need it* and shut it back down again (and Dispose of the handle you allocated) as soon as you're through (before returning from one of your 4 DA procedures). You can screw up the current application if you leave SF started when the app didn't start it itself. If the app *did* start it, just use it and *don't* shut it down, of course. >In a program I'm writing I need to draw a window (it's a help window) with >a lot of text in it--maybe 8 typed pages. Now of course not all of this text >can be displayed at once in the window, but whenever the window needs to be >updated (e.g. when it's first drawn, when the user uses the window's scroll bar, >etc.) it takes a long time to redraw because it seems to have to redraw ALL of >the text, even though only a small part of it shows. I'm using DrawString to >draw the text in the window. Any suggestions on making it faster, like >a word processor or text editor does? Thanks a lot. You can use GetPortRect to find out which part of the window you're scrolled to, or you can get the bounding box of the update region. More details on request--gotta take off! --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.