Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!well!smoke From: smoke@well.sf.ca.us (Nicholas Jackiw) Newsgroups: comp.sys.mac.programmer Subject: Re: Can I modify the Text Window title in THINK Pascal? Message-ID: <21121@well.sf.ca.us> Date: 10 Oct 90 22:39:25 GMT References: <1990Oct9.062443.18141@agate.berkeley.edu> Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 33 In article <1990Oct9.062443.18141@agate.berkeley.edu> bmyers@garnet.berkeley.edu (Brian Myers) writes: >The following simple program does not work (in THINK's Lightspeed Pascal): > > ShowText; {makes TextWindow visible, active} > wPtr:=FrontWindow; {should give handle to Text Window} > GetWTitle(wPtr, theTitle); {should retrieve title string} > WriteLn(theTitle); {should display title string} >I now suspect that THINK Pascal somehow protects its standard windows (Text, >Drawing, etc) from your own programs as they run. Might the compiler >somehow remove these windows, even though they exist on the screen, from the >system queue? Is that even possible? Or why else am I getting garbage? That's right and that's possible. THINK Pascal patches FrontWindow so that it never returns one of the (internal) windows--e. g. the Text window, the Lightsbug window, a source code window, etc. Whether this patch is installed only when running "under the environment" is unclear to me. Regardless, if you're trying to work under the environment, it's in effect. That's why you'll want to go to the WindowList constant, which is not accessed through a (potentially patchable) trap, as you mentioned in your last post. Or you could ignore your aversion to the title TEXT. -- --- * --- Nicholas Jackiw Smoke@well.sf.ca.us | Jackiw@cs.swarthmore.edu Key Curriculum Press, Inc. Applelink: D3970 | (415) 548-2304 --- * ---