Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!tank!uwvax!astroatc!nicmad!madnix!aaron From: aaron@madnix.UUCP (Aaron Avery) Newsgroups: comp.sys.amiga.tech Subject: Re: inputs from many windows. Keywords: windows, messages, IDCMP, stupid! Message-ID: <439@madnix.UUCP> Date: 30 Jan 89 11:51:57 GMT References: <1918@pur-phy> Reply-To: aaron@madnix.UUCP (Aaron Avery) Distribution: comp.sys.amiga.tech Organization: ASDG Incorporated Lines: 30 In article <1918@pur-phy> tlm@newton.physics.purdue.edu.UUCP (Timothy Lee Meisenheimer) writes: >you suggest looking at all the UserPorts? Replacing all the UserPorts with >that of the first one? (that sounds fishy!) Thanks for any help. Well, that may sound fishy, but it's what the manual says to do and what works. Well, a variant anyway. What you want to do is to only define any IDCMPFlags in one of the windows before you open it. This window will then have a UserPort allocated for it. Now, after you open other windows with IDCMPFlags set to NULL, you set their UserPort variables to the one allocated for the first window. Now, call ModifyIDCMP() on those windows, saying which flags you want them to respond to. Now, all IDCMP messages for all windows will come in to that one UserPort. The IntuiMessage structure you are passed contains a pointer to which window the message pertains to (IDCMPWindow, a pointer to its Window structure). Later, when you go to close the windows, set all but one of the UserPort's to NULL before closing them. I'd suggest calling ModifyIDCMP() and clearing all flags before putting NULL in the UserPort. That's probably safest, but wasn't mentioned in my manual. Also note that you could just as well allocate your own message port and use that one, not having Intuition allocate even that one. If the IDCMPFlags variable is NULL when you call OpenWindow(), Intuition won't allocate a port. If the IDCMPFlags variable is non-NULL when you call ModifyIDCMP(), intuition won't allocate a port. That's how we controlled the port's allocation above. -- Aaron Avery, ASDG Inc. "A mime is a terrible thing to waste." -- Robin Williams ARPA: madnix!aaron@cs.wisc.edu {uunet|ncoast}!marque! UUCP: {harvard|rutgers|ucbvax}!uwvax!astroatc!nicmad!madnix!aaron