• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Question about tracking rects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about tracking rects


  • Subject: Question about tracking rects
  • From: Christopher Drum <email@hidden>
  • Date: Sat, 18 Dec 2004 16:25:33 -0800

I have a little palette of color swatches in my application. Each swatch has a tracking rect to check for mouseEntered and mouseExited. Upon enter, a BOOL highlight; flag is set, so that the user gets a blue outline around the currently selected swatch. Upon exit, flags are set as necessary to turn off the highlight and some other clean up is done. mouseEntered tells the drawRect to only update the newly selected color swatch rect. The mouseExited tells drawRect to update the just exited color swatch rect.

Each tracking rect is adjacent to the previous rect, so all the palette swatches butt up next to one another.

Here's my problem. The code works great, so long as I drag the cursor from right to left across the tracking rects. If I drag from left to right, I get odd behavior in the palette. Namely, the color in each swatch shifts to the left by one. In logging the code, I find that if I drag from right to left with the cursor, I get messages saying that I have exited the current swatch and then entered the new swatch. However, from left to right the messages say that I have entered the new swatch and then exited the old swatch. The exit/enter calls are reversed, depending up on the direction I drag the cursor.

Is this documented behavior? For me, it means my flags are getting set in the wrong order, leading to oddball drawing.

------------------------------------------------------------------
Christopher Drum
http://homepage.mac.com/christopherdrum

Check out FileWrangler, my five-star rated (MacUpdate, VersionTracker) Cocoa app written in Objective-C for the batch renaming of files.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: How to capture a full screen image
  • Next by Date: Services Bug in 10.3.6/7?
  • Previous by thread: Re: How to capture a full screen image
  • Next by thread: Services Bug in 10.3.6/7?
  • Index(es):
    • Date
    • Thread