home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17405 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!gregg
  3. From: gregg@cbnewsc.cb.att.com (gregg.g.wonderly)
  4. Subject: Re: Multiple Windows
  5. Organization: AT&T
  6. Date: Tue, 15 Dec 1992 23:33:47 GMT
  7. Message-ID: <1992Dec15.233347.20801@cbnewsc.cb.att.com>
  8. References: <8771@orbit.cts.com>
  9. Lines: 25
  10.  
  11. From article <8771@orbit.cts.com>, by chucks@pnet51.orb.mn.org (Erik Funkenbusch):
  12. > So, my solution would be to have my IDCMP Dispatch routine know which window
  13. > it's dealing with and handle the appropriate gadget based on that.
  14.  
  15. You can use imsg->IDCMPWindow to tell which window dispatch function
  16. to go to.  This is by far the easiest.  I.e.
  17.  
  18.     while( 1 )
  19.     {
  20.         got = Wait( mask );
  21.         while( imsg = GetMsg( windowport ) )
  22.         {
  23.             if( imsg->IDCMPWindow == OptsWnd )
  24.                 OptsEvent( imsg );
  25.             else if( imsg->IDCMPWindow == MainWnd )
  26.                 MainEvent( imsg );
  27.             else if( imsg->IDCMPWindow == PrefsWnd )
  28.                 PrefsEvent( imsg );
  29.             else
  30.                 Oops bad IDCMP...
  31.  
  32.             ReplyMsg( imsg );
  33.         }
  34.     }
  35.  
  36.