Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcvax!hp4nl!janus!dolf
From: dolf@janus.UUCP (Dolf Starreveld)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A *** SERIOUS *** (but small) BUG IN SUITCASE II!
Message-ID: <778@janus.UUCP>
Date: 9 Aug 89 20:09:55 GMT
References: <21867@andante.UUCP> <24320@santra.UUCP>
Lines: 32

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.
>	.... Trimmed ....

>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.
Correct, this could even happen before Suitcase ever existed, because not
all DA programmers were doing what you are doing and restoring the original
port on exit. I don't have the docs handy right now, but it says somewhere
in IM-I that you should preserve the current port across calls to DAs (or
was it in a Tech Note, I'm not sure, but this info is very old). The confusing
thing is that IM also says that the desk manager preserves the current port
for you, but it doesn't.
> ... Trimmed ...
As far as I can see, preserving "thePort" whenever you call desk accessories
or anything else that might pop up windows in unexpected ways (read something
that is beyond your own control), or might change the current port, will
solve your problems.

--dolf

-- 
Dolf Starreveld  Phone: +31 20 592 5056/+31 20 592 5022, TELEX: 10262 HEF NL
EMAIL:           dolf@fwi.uva.nl (dolf%fwi.uva.nl@hp4nl.nluug.nl)
SNAIL:           Dept. of Math. and Computing Science, University of Amsterdam,
                 Kruislaan 409, NL-1098 SJ  Amsterdam, The Netherlands