Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!well!wdh From: wdh@well.sf.ca.us (Bill Hofmann) Newsgroups: comp.sys.mac.programmer Subject: Re: How's the screen cleaned after _SysError? Summary: set up DsAlertRect, BCLR #7,DsWndUpdate Keywords: Hacks, The Debugger Message-ID: <16461@well.sf.ca.us> Date: 1 Mar 90 19:04:37 GMT References: <34252@news.Think.COM> Reply-To: wdh@well.UUCP (Bill Hofmann) Organization: Flashpoint Lines: 35 In article <34252@news.Think.COM> ephraim@Think.COM (Ephraim Vishniac) writes: >How is the screen restored after a call to _SysError? > >The reason I'm asking about this is that I'd like to be able to display an >alert at just about any time (much like the disk-swap alert, and for >similar reasons) and then clean up nicely. Right now, I'm waiting for the >next call to _GetOSEvent and using _PaintBehind to get the alert rect >redrawn. This works, but it's not as smooth as whatever the disk-swap code >does. The Debugger is much handier for obscure trivia like this. Its listing for DSWndUpdate is "GetNextEvent not to paintBehind DS AlertRect", and looking at the code for EventAvail and GetNextEvent, it does something like this: BSET #7,DsWndUpdate BNE.S out ...GetPort(curPort) SetPort(WMgrPort) SUBQ #4,a7 _FrontWindow SUBQ #4,a7 _NewRgn MOVEA.L (a7),a3 PEA DsAlertRect ; $3f8 PUSH.L a3 _PaintBehind PUSH.L a3 _DisposRgn ...SetPort(curPort) So to force a cleanup, just BCLR #7,DsWndUpdate, being sure DsAlertRect is properly set up. But how about using the Notification Manager? That'll let you put up an alert in front of everything, in a much less hackish way. -Bill Hofmann PS: How're things?