[comp.sys.mac.programmer] Preserving thePort

jmunkki@kampi.hut.fi (Juri Munkki) (08/10/89)

In article <778@janus.UUCP> dolf@janus.UUCP (Dolf Starreveld) writes:
>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.

I haven't seen this done in any sample applications. That's the major
reason I posted to the net. If sample applications do not protect
themselves from nasty DAs, I guess commercial applications probably
behave the same way.

Most programs are probably protected because they never restore
thePort after drawing. They keep changing the grafport to something
valid so often that it is very improbable that a DA will crash.
An improbable crash is still a crash and should be considered a bug.

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
|     Juri Munkki jmunkki@hut.fi  jmunkki@fingate.bitnet        I Want   Ne   |
|     Helsinki University of Technology Computing Centre        My Own   XT   |
^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^