Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!udel!princeton!phoenix!kenchiu From: kenchiu@phoenix.Princeton.EDU (Kenneth Chiu) Newsgroups: comp.sys.amiga Subject: Re: Help on ModifyIDCMP() Message-ID: <2124@phoenix.Princeton.EDU> Date: 22 Mar 88 02:33:15 GMT References: <489@zehntel.UUCP> <2108@phoenix.Princeton.EDU> <46314@sun.uucp> Reply-To: kenchiu@phoenix.Princeton.EDU (Kenneth Chiu) Organization: Princeton University, NJ Lines: 36 In article <46314@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes: >In article <2108@phoenix.Princeton.EDU> (Kenneth Chiu) writes: >>If you mean one port for several windows, you can do this by attaching your >>own port before a call to OpenWindow() or ModifyIDCMP(). >Have you tried this? In the Intuition Manual the 'blessed' way of opening >a window without an IDCMP port is to open it with NULL IDCMP Flags, then >copy the port to it's UserPort area and use ModifyIDCMP() to enable the >desired events. I'm sorry, I didn't mean to suggest that you can attach a port to a NewWindow structure. I've done things exactly as they say in the manual, and it seems to work fine. I am a little concerned about something that isn't quite clear, however. How careful do you have to be about replying to all messages? At some point, my program will receive some kind of "close window" message (probably from the close gadget). Now, some amount of time will pass between the time I get the message, and the time I actually close the window. During that time I can get other messages from that window. I can just assume that Intuition will properly unlink such messages, and hope for the best. The manual says Intuition will reclaim them, but it isn't specific about how cleanly it does this. Another solution is to Forbid(), search through the message list, throw away all messages pertaining to that window, close the window, and then Permit(). But this could deadlock if Intuition won't close the window until I Permit(), and I won't Permit() until I return from the CloseWindow() call, and the CloseWindow() call is blocking. Oh well, I guess I just have to play around some and see what really happens. . . Ken Chiu