Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!uwm.edu!dogie.macc.wisc.edu!decwrl!polyslo!rcfische From: rcfische@polyslo.CalPoly.EDU (Raymond C. Fischer) Newsgroups: comp.sys.mac.programmer Subject: Re: who caps the window list with nil and when? Message-ID: <25d0a2fa.7177@polyslo.CalPoly.EDU> Date: 7 Feb 90 22:36:42 GMT References: <3858@hub.UUCP> Reply-To: rcfische@polyslo.CalPoly.EDU (Raymond C. Fischer) Organization: Cal Poly State University -- San Luis Obispo Lines: 21 In article <3858@hub.UUCP> 6600pete@ucsbuxa.ucsb.edu writes: >In the midst of throwing together a quick FKEY, I needed to see if there >were at least two windows open. So I checked FrontWindow and if it wasn't >NIL I checked WindowPeek(FrontWindow)^.nextWindow to see if IT was NIL. > >Turns out that NewWindow doesn't cap the end of the window list with NIL >like I would have expected it to. Lots of existing apps don't know about >this and don't care. I think you're mis-interpreting the results your seeing from this test. It is not uncommon to see 0-1 windows on the screen, and yet find that FrontWindow points to another WindowRecord, which then points to another WindowRecord. What's the explanation? To check for more than one _visible_ window, not only do you need to follow the links, but you also need to make sure each window is visible. The list _is_ capped with a NIL, but not all windows on the list are visible. Ray Fischer rcfische@polyslo.calpoly.edu