Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!oliveb!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: NOISYREQ anomaly Message-ID: <44266@sun.uucp> Date: 4 Mar 88 19:10:40 GMT References: <23669@amdahl.uts.amdahl.com> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 40 Keywords: VT100 NOISYREQ window close requester In article <23669@amdahl.uts.amdahl.com> (Tony Sumrall) writes: >Case A: I have a requester up in a window. The requester does NOT have >NOISYREQ set. When I click on the window close gadget I hang. > >Case B: I have a requester up in a window. The requester DOES have >NOISYREQ set. When I clock on the window close gadget I get a WINDOWACTIVE >message. > >Does this seem strange to anyone besides me? Is this a bug? I have noticed this behaviour as well, and just wrote it off as 'normal' Basically, there are a few message classes that will get through to your requester and when you think about it, it is useful that they do. One of them is of course, CLOSEWINDOW since it is entirely possible to put up a requester in a very small window that gets clipped into nothing at all. Like so : Window +-+-------+ |+|=======| +-+-------+ | | | | +----------------+ +---------+ | | | Requester | +----------------+ Now because the requester is rendered completely outside the boundarys of the window it is clipped to zilch. And there is no way to hit it's ENDGADGET. So what to do? Well, since you will see a CLOSEWINDOW message you can escape by doing an EndRequest and exiting. Note I also see ActiveWindow messages as well. What this points out is something that makes for better C programming and that is, when you are switching on a value (such as a Message class) it is preferable to use a switch() statement with a default: clause. Rather than a bunch of if-else constructs. That would save you from this sort of problem. Generally I have a standard "handle intuimessages" loop that I copy around. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.