Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!crash!pnet01!billk From: billk@pnet01.cts.com (Bill W. Kelly) Newsgroups: comp.sys.amiga.tech Subject: Re: inputs from many windows. Message-ID: <3778@crash.cts.com> Date: 30 Jan 89 08:37:01 GMT Sender: news@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 35 cunniff@hpfcdc.HP.COM (Ross Cunniff) writes: >In article <1918@pur-phy> tlm@pur-phy (Timothy Lee Meisenheimer) writes: >> Well, I'm working on a little project which will have lots of little >> windows around (1 - X where X is related to how obnoxious you're feeling) >> and I'll be getting inputs (mouseclicks, gadgets, kill etc.) from them >> all... >> ...what have you done in your event loop to read >> all these messages and tell which window they come from? > >Well, probably the best thing is to share the same IDCMP port between >all your windows. To do this, first get an IDCMP (from the first OpenWindow >will do nicely). When you open subsequent windows, don't specify ANY >IDCMP events in the NewWindow structure. Instead, do the following: > > Win = OpenWindow( &NewWin ); > Win->UserPort = OrigWin->UserPort; > ModifyIDCMP( Win, MOUSEBUTTONS|MOUSEMOVE|... (whatever) ); > [rest of message and sample code for closing window deleted] Ok, I give up. What's the _probem_ with allowing these poor little windows to each have their own IDCMP's? It doesn't seem as though it would require more code for each window to have its own IDCMP -- in fact, it seems like a much simpler/safer way to go than the alternative. Am I missing something? bill -- Bill W. Kelly billk@pnet01.cts.com {nosc ucsd hplabs!hp-sdd}!crash!pnet01!billk crash!pnet01!billk@nosc.mil