Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!ucbvax!POSTGRES.BERKELEY.EDU!dillon From: dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga.tech Subject: Re: inputs from many windows. Message-ID: <8902021944.AA19622@postgres.Berkeley.EDU> Date: 2 Feb 89 19:44:47 GMT Sender: usenet@ucbvax.BERKELEY.EDU Lines: 42 Another solution to the signal-bit problem which I have yet to try, but which also seems workable, is to just open up a lot of windows w/ independant IDCMP ports. But nobody ever said they had to have *different* signal bits!! That's right, once you get the port back, simply modify SigBit to some common signal bit and then FreeSignal() the one that came with the port. When you CloseWindow() a window, first replace SigBit with a newly allocated one (which the workbench will immediately deallocate when it deletes the port). I.E.: Short MasterSigBit; main() { short tmp; MasterSigBit = AllocSignal(-1); ... win = OpenWindow(&Nw); tmp = win->UserPort->mp_SigBit; win->UserPort->mp_SigBit = MasterSigBit; FreeSignal(tmp); ... win->UserPort->mp_SigBit = AllocSignal(-1); CloseWindow(win); } Now, this isn't quite as nice as sharing a single IDCMP port because you now have to poll all the active window's ports whenever you get a signal, but neither do you have to screw around much either. Note that a simple 'window cache' .. I.E. remembering the last window that an IDCMP came from and checking that first .. will yield almost the same efficiency as sharing an IDCMP port. -Matt