Path: utzoo!attcan!utgpu!watmath!iuvax!purdue!mailrus!caen.engin.umich.edu!mystone
From: mystone@caen.engin.umich.edu (Dean Yu)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A *** SERIOUS *** (but small) BUG IN SUITCASE II!
Message-ID: <44ed484a.19c13@locust.engin.umich.edu>
Date: 9 Aug 89 14:35:00 GMT
References: <21867@andante.UUCP> <24320@santra.UUCP>
Reply-To: mystone@sol.engin.umich.edu
Organization: Computer Aided Engineering Network, University of Michigan
Lines: 39

In article <24320@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes:
>I just discovered that I had wasted several weeks hunting down a bug in
>my source code, when it actually wasn't there. The problem was that somehow
>the system was using grafports that didn't exist.
>
>I always use the sequence:
>	GetPort(&saved);
>	SetPort(someport);
>	...
>	SetPort(saved);
>
>This means that when InitWindows sets the port to the window manager port,
>it usually remains that way for the rest of my program. I verified this
>with a debugger.
>
>I then proceeded to start with Suitcase II (v 1.2.2) enabled and the
>behavior changed. Whenever I opened a desk accessory, the port would
>change to that window. The problem is that when the desk accessory is
>closed, the port (thePort for you programmers) stays in that now
>defunct window.
>

  This isn't a bug in Suitcase, but a problem with some DAs.  It's fairly
well known that some older DAs don't restore the grafPort when they close
or get switched out.

_______________________________________________________________________________
Dean Yu                            | E-mail: mystone@{sol,caen}.engin.umich.edu
University of Michigan             | Real-mail: Dean Yu
Computer Aided Engineering Network |            909 Church St
                                   |            Apt C
===================================|            Ann Arbor, MI 48104
                                   | Phone: Given on a need to know basis, and
"I am the Merit Host.  I speak for |        only if you're going to offer me a
 the bitstream."  (In other words, |        job...
 these are my very own opinions;   | 
 my employer wants to have nothing |===========================================
 to do with them, or me.)          |       This space available for rent
-------------------------------------------------------------------------------