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