home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20693 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.3 KB  |  31 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!csn!qwerty-gw.fsl.noaa.gov!yoda.fsl.noaa.gov!urban
  3. From: urban@yoda.fsl.noaa.gov (Art Urban)
  4. Subject: Detecting mouseDown in a region?
  5. Message-ID: <1993Jan5.171920.29754@fsl.noaa.gov>
  6. Sender: urban@fsl.noaa.gov 
  7. Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
  8. Date: Tue, 5 Jan 1993 17:19:20 GMT
  9. Lines: 20
  10.  
  11. Just in case this is important, I'm using TCL for my app. I suspect that it
  12. isn't.
  13.  
  14. Okay, here's the situation:
  15.  
  16. I have many (let's say 1000) predefined regions in a window (CPane). When
  17. the user clicks in the window, one of the regions will have neccessarilly
  18. been hit, since they are all adjacent to one another. I need to determine
  19. which region was the recipient of the mouseDown.
  20.  
  21. Am I supposed to loop through all my regions, checking PtInRegion() for
  22. each one until I get a hit? This seems very brute force, and could possibly
  23. become slow if the user clicks in the 1000th region. Is there any way I can
  24. reduce the possibilities?
  25.  
  26. -- 
  27. Art Urban                             urban@yoda.fsl.noaa.gov
  28. ===============================================================================
  29.  "Look, he's being attacked by creamy nugget centers."              -Joel
  30. ===============================================================================
  31.