Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!well!svc From: svc@well.UUCP (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: GetRsrc strange in LSP Summary: Correct, but... Message-ID: <12384@well.UUCP> Date: 25 Jun 89 04:03:45 GMT References: <24302@srcsip.UUCP> <32576@apple.Apple.COM> <12322@well.UUCP> <24471@srcsip.UUCP> Distribution: na Lines: 31 In article <24471@srcsip.UUCP>, mnkonar@manyjars.SRC.Honeywell.COM (Murat N. Konar) writes: > In article <12322@well.UUCP> svc@well.UUCP (Leonard Rosenthol) writes: > [edited for length] > >> [ problems with GetResource in LSP WDEF worked around by storing > >> handle to resource in theWindowPeek^.dataHandle]] > >>Beleive it or not YOU NEED TO DO THIS! When running on MultiFinder, (and your >>WDEF gets a draw message) from the>foreground your WDEF will get called FROM >>THE FOREGROUND APPS HEAP! This means>that your GetResource will probably fail >>since it won't be able to find your appl resources that it needs. > > Unless the resource is loaded into the system heap, right? Or am > I missing something? > That's true. If the resource is loaded into the system heap, then your WDEF can find it - but you should be VERY careful about resources into the system heap. If, for example, your WDEF needed to get at a particular FONT to use, loading it into the system heap would give users a real headache figuring why the only saw font 'xxx' in MacWrite SOMETIMES... The same is true for most 'standard' resource types since there are LOTS of programs which display resource lists in one form or another. I ran into this problem recently when I needed a WDEF which drew the window title in a different FONT than the system font. I ended up using the refcon to store the FONT resource so that I could get to later on, and that would seem to be (as discussed earlier) the best method. -- +--------------------------------------------------+ Leonard Rosenthol | GEnie : MACgician Lazerware, inc. | MacNet: MACgician UUCP: svc@well.UUCP | ALink : D0025